Possible to upgrade all sub-wikis at once

I run an XWiki instance for my department and we currently have 20+ sub-wikis, one for each team, and running upgrades on our environment has been quite the chore lately. Is it possible to upgrade all the sub-wikis at once?

After we update our container and go through the distribution wizard we get to the “Wikis” where we can see all of our sub-wikis. (This issue is present in out test environment, hence the sub-wiki names…)
image

And I thought I could just press “Install on farm” and have it upgrade all of the sub-wikis with this flavor installed.
image

However, I receive this error message:
image

Error text:

Extension [org.xwiki.platform:xwiki-platform-distribution-flavor-wiki/15.10.4] is not allowed on namespace [null]. Allowed namespaces are: [[wiki:(?!xwiki$).*]]
class org.xwiki.extension.InstallException: Failed to resolve extension
    at org.xwiki.extension.job.internal.AbstractInstallPlanJob.installExtension(AbstractInstallPlanJob.java:872)
    at org.xwiki.extension.job.internal.AbstractInstallPlanJob.installExtension(AbstractInstallPlanJob.java:317)
    at org.xwiki.extension.job.internal.AbstractInstallPlanJob.installExtension(AbstractInstallPlanJob.java:285)
    at org.xwiki.extension.job.internal.AbstractInstallPlanJob.start(AbstractInstallPlanJob.java:216)
    at org.xwiki.extension.job.internal.InstallPlanJob.runInternal(InstallPlanJob.java:74)
    at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:246)
    at org.xwiki.job.AbstractJob.run(AbstractJob.java:223)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: class org.xwiki.component.namespace.NamespaceNotAllowedException: Extension [org.xwiki.platform:xwiki-platform-distribution-flavor-wiki/15.10.4] is not allowed on namespace [null]. Allowed namespaces are: [[wiki:(?!xwiki$).*]]
    at org.xwiki.extension.job.internal.AbstractInstallPlanJob.installExtension(AbstractInstallPlanJob.java:987)
    at org.xwiki.extension.job.internal.AbstractInstallPlanJob.installExtension(AbstractInstallPlanJob.java:869)
    at org.xwiki.extension.job.internal.AbstractInstallPlanJob.installExtension(AbstractInstallPlanJob.java:317)
    at org.xwiki.extension.job.internal.AbstractInstallPlanJob.installExtension(AbstractInstallPlanJob.java:285)
    at org.xwiki.extension.job.internal.AbstractInstallPlanJob.start(AbstractInstallPlanJob.java:216)
    at org.xwiki.extension.job.internal.InstallPlanJob.runInternal(InstallPlanJob.java:74)
    at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:246)
    at org.xwiki.job.AbstractJob.run(AbstractJob.java:223)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)

Is it possible to do what I am asking, or am I supposed to hit Upgrade/Continue all of the sub-wikis individually?

2 Likes

This is normal since you’re trying to install an Extension (the “XWiki Standard Flavor for sub-wikis” one) which is made for sub wikis and thus cannot be installed on the main wiki. Basically wiki:(?!xwiki$).* means all wikis except xwiki (which is the main wiki).

I thought there was a “Upgrade all wikis” button but I don’t see it on https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/DistributionWizard#HWikis which is strange as I’m pretty sure we used to have this feature in the past. cc @tmortagne who might know more.

Thx

This step you are mentioning (which have nothing to do with the very generic Extensions update step in the screenshot) only exists in default UI mode (where all subwikis have the same default UI without the concept of flavor choice) but with flavors, each wiki has its own thing.

1 Like

When having many subwikis, and there are at most a very few modifications to the UI, I usually set:

 distribution.job.interactive=false
 distribution.job.interactive.wiki=false

in xwiki.properties.
That way I only need to log in as a user with programming rights, and need to call all subwikis. There is no distribution wizard, and the steps are running in the background.

The main disadvantage is that in non-interactive mode the upgrade process never removes outdated extensions. That has created a problem for one XWiki version where the CKEditor was moved from Contrib into the Platform, and to upgrade one needed to disable the feature for the main wiki, as the upgrade process needed to remove the contrib version of the CKEditor.
As I figured this out only after the first (failed) attempt, I had to recover from a backup and retry. If the upgrade process fails in non-interactive mode, it will not restart even wen disabling non-interactive code, except if revocering from a backup made before the upgrade. Another reason why one always should make a full backup before upgrading.

One can even have the upgrade process completely non-interactive by temporarily enabling the superadmin account and sending one request to each subwikis in a loop on the commandline with wget or curl , passing the superadmin credentials. After the migration is finished, of course better disable the superadmin in the xwiki.cfg and restart the server. That might be only neccessary with really big installations with 50+ subwikis.