Right way to import a subwiki (SOLVED)

Hi,

I wonder on how I can import a backup of a subwik?
When I try to import a subwiki it replaces the main wiki.

Ciao

Import is done in the current wiki (the XAR does not really contains the target wiki) so you need to create the subwiki first and then use that subwiki import UI.

After importing the main wiki all subwikis are listed in the wiki index.
When I try to access the subwiki exceptions an exception came up and make it impossible to access the subwikis administration page.

Do I need to delete and recreate the subwiki first ?

Indeed, this is because the list of subwiki is stored on main. But it does not mean those wiki really exist, in short you have the index but not the actual wiki.

What is missing after you import the main wiki is the actual empty database of each subwiki. The simplest would probably be to do the same as what you did for the main wiki: create the empty database for each of those wikis.

OK thanks, that makes things much better to understand.
But what would be the right process to move XWiki content to another instance.

Importing the main wiki first and import subwikis later or create all subwikis at first import them and import the main wiki after all others were imported ?

The right way to backup XWiki is usually to backup the database directly and not using the XAR format which is missing stuff like statistics and events. See https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Backup.

The XAR format is more suited for:

  • moving content from one wiki to another
  • moving your wiki to a different database engine
  • as last resort upgrade when there is a problem when upgrading from a very old version (which is always a bug but not always easy to fix)

You can’t access a subwiki if it’s not listed in the main wiki. If you really are in a use case where using XAR package is required you should create all the database in the database engine and then import the main wiki and the subwikis one by one.

OK thanks a lot. I have the need to manually upgrade parts of an old XWiki instance (8.3) to a new one.
As I understand the backup guide it will not work to make a backup and restore over release boundaries.

I have tried to upgrade the 8.3 instance several times but had no luck to do so.

Thanks for your patience.

8.3 is not very old, if standard upgrade fail you should definitely give more details about it as it’s quite a blocker IMO.

OK I will give it another try. May be my new knowledge can help me :wink:

Imported 8.3 to 9.4 and it worked fine. Just a few adjustments to make it work again.
Thanks for your support.