Introduction
This article treats backup, restore and upgrade not as an abstract concept, but as a verifiable runbook for XWiki with database, attachments, extensions and configuration.
Test Environment and Assumptions
The examples use neutral lab names such as wiki.example.test and xwiki01.example.test. They show real work steps but contain no production hostnames, credentials or internal paths.
- XWiki runs behind a reverse proxy with HTTPS.
- PostgreSQL is used as the database.
- Attachments and XWiki state live in a persistent directory.
- Administration is done through the XWiki UI and supplemented on the shell.
Runbook
- Inventory: database, permanent storage, extensions, configuration.
- Create a consistent backup.
- Restore into an isolated test instance.
- Validate search, attachments, permissions, mail and extensions.
- Upgrade only after the restore test has passed.
What Matters Most in This Part
For backup, restore and upgrade, technical state and UI behavior must match. A command can be green while users still cannot find a page, lack permissions or have unusable search.
Before the Change: Establish a Baseline
curl -fsS -o /dev/null -w '%{http_code}\n' https://wiki.example.test/bin/view/Main/systemctl is-active tomcat postgresql nginxdf -h /srv/xwiki/permanent
Navigation in XWiki
- Log in and open the menu in the upper right.
- Choose Administration.
- First review Users & Rights, Extensions, Search and Mail on the left.
- Then switch to the affected space and validate space permissions, pages and attachments.
- Finally test with a normal user, not only with the administrator.
Implementation
Run backup and restore
install -d -m 0700 /backup/xwiki/$(date +%F)systemctl stop tomcatpg_dump -Fc -f /backup/xwiki/$(date +%F)/xwiki.dump xwikirsync -aHAX --numeric-ids /srv/xwiki/permanent/ /backup/xwiki/$(date +%F)/permanent/rsync -aHAX --numeric-ids /etc/xwiki/ /backup/xwiki/$(date +%F)/etc-xwiki/systemctl start tomcat
createdb -O xwiki xwiki_restorepg_restore -d xwiki_restore /backup/xwiki/2026-10-10/xwiki.dumprsync -aHAX /backup/xwiki/2026-10-10/permanent/ /srv/xwiki/permanent/systemctl restart tomcat
Step by Step: XWiki Backup, Restore and Upgrade
This workflow is intentionally written as an operational guide. The goal is not only to trigger a backup, but to prove that XWiki is usable again after restore or upgrade. Placeholders such as wiki.example.test, xwiki01.example.test and /srv/xwiki/permanent must be replaced by the real environment.
1. Capture system baseline
Before every backup or upgrade window, record which XWiki version is running, where data is stored and which services are involved. This baseline is the comparison point after restore or upgrade.
curl -fsS -o /dev/null -w "%{http_code}\n" https://wiki.example.test/bin/view/Main/\nsystemctl is-active tomcat postgresql nginx\nreadlink -f /var/lib/tomcat/webapps/xwiki\ndu -sh /srv/xwiki/permanent\npsql -U xwiki -d xwiki -c "select now();"
2. Check backup components
A complete XWiki backup is more than the database. If attachments, extension data or configuration are missing, the application may start but still be incomplete for users.
PostgreSQL database: pages, rights, history and metadata.
XWiki permanent directory: attachments, extension data, cache-related state and local files.
XWiki configuration: xwiki.cfg, xwiki.properties, hibernate.cfg.xml and all deliberate custom files.
Tomcat and reverse proxy configuration: context, ports, headers, TLS and upload limits.
Operations documentation: active version, extension list, backup target, restore target and owner.
3. Back up the database consistently
For small environments, a maintenance window with a database dump may be enough. In larger environments, snapshots or backup agents should make sure database and permanent directory belong to the same point in time.
backup_id="$(date +%Y%m%d-%H%M%S)"\ninstall -d -m 0750 /backup/xwiki/${backup_id}\npg_dump -Fc -U xwiki -d xwiki > /backup/xwiki/${backup_id}/xwiki-db.dump\nsha256sum /backup/xwiki/${backup_id}/xwiki-db.dump > /backup/xwiki/${backup_id}/SHA256SUMS
4. Back up attachments and XWiki state
The permanent directory must match the database state. If files are uploaded during backup, use a maintenance window, snapshots or a coordinated backup method.
rsync -aH --numeric-ids /srv/xwiki/permanent/ /backup/xwiki/${backup_id}/permanent/\ntar -C /etc -czf /backup/xwiki/${backup_id}/xwiki-config.tar.gz xwiki tomcat nginx\nsha256sum /backup/xwiki/${backup_id}/xwiki-config.tar.gz >> /backup/xwiki/${backup_id}/SHA256SUMS
5. Prepare the restore target
The restore test belongs on a separate system or isolated test environment. The test FQDN must be clearly different so nobody accidentally uses production links, webhooks or mail paths.
Same XWiki version or deliberately documented upgrade path.
Separate database or empty schema.
Dedicated test FQDN with its own TLS certificate.
Mail delivery and external integrations disabled or clearly redirected in the test.
No production user activity on the restore test system.
6. Restore database and files
During restore, restore the database first, then the permanent directory, then adapt configuration deliberately. Start Tomcat only after that.
systemctl stop tomcat\ndropdb --if-exists xwiki_restore\ncreatedb xwiki_restore\npg_restore -U xwiki -d xwiki_restore /backup/xwiki/${backup_id}/xwiki-db.dump\nrsync -aH --delete /backup/xwiki/${backup_id}/permanent/ /srv/xwiki/permanent/\nrestorecon -Rv /srv/xwiki/permanent 2>/dev/null || true\nsystemctl start tomcat
7. Browser acceptance after restore
Now the important part begins. A green service status is not enough. Open XWiki in the browser and test real user paths: login, pages, attachments, search and permissions.
Log in as local admin and open global administration.
Open a known page from a production-like space.
Download an attachment and check whether the file size is plausible.
Test the same page with a normal user.
Search for a known page title and a term inside a page.
Check Tomcat, XWiki, PostgreSQL and Nginx logs for new errors.
8. Test the upgrade on the restore system first
An upgrade should run against the restored test instance first. Then complete Distribution Wizard, Extension Manager and browser paths. Only when this workflow is stable should the upgrade move into a production maintenance window.
Read release notes and check extension compatibility.
Restore a test instance from the current backup.
Run the upgrade and save complete output.
Complete the Distribution Wizard in the browser.
Open Extension Manager and document incompatible extensions.
Test login, permissions, attachments, search and important spaces again.
9. Do not only claim rollback
Rollback means database state, permanent directory, webapp version and configuration fit together again. The return path must therefore be known before the production upgrade and should be exercised at least once in the test environment.
Practical Orientation: Making Restore and Upgrade Reproducible
An XWiki backup is only reliable when a business user can work with the wiki again after restore. The test should not end when Tomcat starts successfully. Open real pages in the browser, download attachments, test search and check a page with restricted permissions.
Minimal restore test for newcomers
For a first production-like check, use a small but complete test scope. The test should run in an isolated environment so mails, webhooks or external integrations are not triggered accidentally. Document the steps so another person can repeat them.
Clearly label the test URL and test system.
Restore database and XWiki permanent directory from the same backup point.
Log in as local admin and open global administration.
Open a page with an attachment and download the attachment.
Search for a page that certainly existed before the backup.
Check with a normal user whether permissions behave the same after restore.
Finish the upgrade in the browser
After an XWiki upgrade, updating packages or the WAR file is not enough. XWiki often displays the Distribution Wizard or extension steps in the browser. These steps are part of the upgrade and must be completed deliberately. Only then is the application functionally valid.
After the wizard, check the homepage, Extension Manager, search, a page with macros and a page with attachments. If extensions are incompatible, this should appear in the test system and not during the production maintenance window.
Plan rollback realistically
Rollback in XWiki is not only copying old files back. If an upgrade changed database structures or extension data, you need to know which database state, permanent storage and webapp version belong together. Every upgrade therefore needs a marked previous state.
Record backup ID or snapshot ID before the upgrade.
Document active XWiki version and extension list.
Do not only describe rollback; execute it at least once in the test environment.
After rollback, test login, attachments and search again.
Only then approve the production maintenance window.
What belongs in the operations runbook
Where backup logs are stored and who reviews them.
How long backups are retained.
How often restore is tested.
Which extensions are critical.
Which business pages are always checked after restore or upgrade.
How Completely Did We Test?
| Area | Evidence | Status |
|---|---|---|
| Browser UI | Homepage, login, global administration, rights management and extension area checked. | Evidenced |
| Technical services | Tomcat, PostgreSQL, reverse proxy, internal Tomcat port and versioned release path checked. | Evidenced |
| Functional visual check | Rights matrix, admin areas, Extension Manager and public reachability checked. | Evidenced |
| Mutating tests | Restore, reindex, mail delivery or attachment upload are only performed in an agreed test space and are not claimed here. | Scope limit |
Browser UI
- Evidence
- Homepage, login, global administration, rights management and extension area checked.
- Status
- Evidenced
Technical services
- Evidence
- Tomcat, PostgreSQL, reverse proxy, internal Tomcat port and versioned release path checked.
- Status
- Evidenced
Functional visual check
- Evidence
- Rights matrix, admin areas, Extension Manager and public reachability checked.
- Status
- Evidenced
Mutating tests
- Evidence
- Restore, reindex, mail delivery or attachment upload are only performed in an agreed test space and are not claimed here.
- Status
- Scope limit
Technical Acceptance
The result check follows the same pattern as the grommunio articles: PASS means the concrete checkpoint was actively executed and evidenced. PASS WITH CONDITIONS, SCOPE LIMIT and NOT TESTED remain visible so a backup runbook does not promise more than was actually verified.
| Area | Check | Result |
|---|---|---|
| Backup scope | Database, XWiki permanent directory, configuration, reverse proxy and TLS renewal path are covered by the runbook. | PASS |
| Backup evidence | Backup artifacts, return code, target path and timestamp are documented. | PASS |
| Restore basis | Restore target system is separate from production and clearly marked as a test system. | PASS |
| Database restore | PostgreSQL dump or snapshot is restored into the test instance. | PASS WITH CONDITIONS |
| Attachments | A page with an attachment is opened after restore and the attachment is downloaded. | PASS WITH CONDITIONS |
| Permissions | An admin and a normal user check the same test page with expected permissions. | PASS WITH CONDITIONS |
| Search | Known page titles and terms return results again after restore. | PASS WITH CONDITIONS |
| Upgrade wizard | Distribution Wizard and Extension Manager are completed in the browser after upgrade. | PASS WITH CONDITIONS |
| Rollback | Backup ID, webapp version and permanent storage point in time belong together. | SCOPE LIMIT |
| Production restore | A mutating restore against production data was not performed in this public article. | NOT TESTED IN THIS PASS |
Backup scope
- Check
- Database, XWiki permanent directory, configuration, reverse proxy and TLS renewal path are covered by the runbook.
- Result
- PASS
Backup evidence
- Check
- Backup artifacts, return code, target path and timestamp are documented.
- Result
- PASS
Restore basis
- Check
- Restore target system is separate from production and clearly marked as a test system.
- Result
- PASS
Database restore
- Check
- PostgreSQL dump or snapshot is restored into the test instance.
- Result
- PASS WITH CONDITIONS
Attachments
- Check
- A page with an attachment is opened after restore and the attachment is downloaded.
- Result
- PASS WITH CONDITIONS
Permissions
- Check
- An admin and a normal user check the same test page with expected permissions.
- Result
- PASS WITH CONDITIONS
Search
- Check
- Known page titles and terms return results again after restore.
- Result
- PASS WITH CONDITIONS
Upgrade wizard
- Check
- Distribution Wizard and Extension Manager are completed in the browser after upgrade.
- Result
- PASS WITH CONDITIONS
Rollback
- Check
- Backup ID, webapp version and permanent storage point in time belong together.
- Result
- SCOPE LIMIT
Production restore
- Check
- A mutating restore against production data was not performed in this public article.
- Result
- NOT TESTED IN THIS PASS
Mandatory Tests After Restore or Upgrade
This list is the actual acceptance core. XWiki should only be released again when these points passed or are explicitly documented as not tested.
| Area | Acceptance point |
|---|---|
| System | Check Tomcat, PostgreSQL, reverse proxy, TLS and free storage. |
| Version | Document active XWiki version, webapp path and extension list. |
| Login | Local admin and normal user work. |
| Content | Open known page, check history and open edit mode. |
| Attachments | Download existing attachment and upload a new test attachment only in an approved test space. |
| Permissions | Test anonymous access, normal user, editor and admin separately. |
| Search | Check known page title, term inside page text and attachment name. |
| Extensions | Distribution Wizard and Extension Manager have no mandatory steps open. |
| Logs | Review Tomcat, XWiki, PostgreSQL and Nginx after the test run. |
| Rollback | Document return path including backup ID and storage state. |
System
- Acceptance point
- Check Tomcat, PostgreSQL, reverse proxy, TLS and free storage.
Version
- Acceptance point
- Document active XWiki version, webapp path and extension list.
Login
- Acceptance point
- Local admin and normal user work.
Content
- Acceptance point
- Open known page, check history and open edit mode.
Attachments
- Acceptance point
- Download existing attachment and upload a new test attachment only in an approved test space.
Permissions
- Acceptance point
- Test anonymous access, normal user, editor and admin separately.
Search
- Acceptance point
- Check known page title, term inside page text and attachment name.
Extensions
- Acceptance point
- Distribution Wizard and Extension Manager have no mandatory steps open.
Logs
- Acceptance point
- Review Tomcat, XWiki, PostgreSQL and Nginx after the test run.
Rollback
- Acceptance point
- Document return path including backup ID and storage state.
What Does PASS Mean in This Test?
PASS does not only mean that a service is running. PASS means that the browser user path works, the technical state is plausible and a second test with restricted permissions produces the expected result.
Pitfalls
- Admin rights are assigned globally although space permissions would be enough.
- Attachments are not stored in the persistent directory.
- Backups include the database but not extensions, configuration and attachments.
- Search is not validated after restore or upgrade.
- Screenshots or documentation contain real internal hostnames.
Final Health Check
curl -fsS -o /dev/null -w '%{http_code}\n' https://wiki.example.test/bin/view/Main/systemctl is-active tomcat postgresql nginxjournalctl -u tomcat --since -1h --no-pager | tail -n 80
Acceptance List
| Acceptance point | Expected result |
|---|---|
| Public URL and admin access | XWiki is reachable and administration opens with an authorized account. |
| User and group model | Groups, roles and break-glass access are documented. |
| Backup scope | Database, attachments, configuration and relevant operations files are included. |
| Restore or rollback | The return path was tested or explicitly marked as an open point. |
| Search and mail function | Search index and mail path are checked after restore or upgrade. |
| Public documentation | The article contains no real hostnames, credentials or secrets. |
Public URL and admin access
- Expected result
- XWiki is reachable and administration opens with an authorized account.
User and group model
- Expected result
- Groups, roles and break-glass access are documented.
Backup scope
- Expected result
- Database, attachments, configuration and relevant operations files are included.
Restore or rollback
- Expected result
- The return path was tested or explicitly marked as an open point.
Search and mail function
- Expected result
- Search index and mail path are checked after restore or upgrade.
Public documentation
- Expected result
- The article contains no real hostnames, credentials or secrets.
Partner Runbook: Order for Your Own Environments
- Build lab or staging system first.
- Then test the XWiki UI with admin and normal user.
- Only then move SSO, permissions, backup and monitoring into production.
- Accept every change with both browser path and shell check.
FAQ
Is it enough if XWiki opens in the browser? Action: Open answerClose answer
No. Login, permissions, search, attachments, mail and backup must also be validated.
Does every installation need SSO? Action: Open answerClose answer
Not necessarily. In production it must be clear whether users are managed locally, through LDAP, OIDC or SAML.
Why focus so much on restore? Action: Open answerClose answer
Because a wiki without attachments, permissions and extensions may start after an incident but is often no longer fully usable for users.
Result control / technical acceptance
The technical acceptance follows the same pattern as the grommunio and SUSE articles: PASS means the specific check was actively performed or clearly evidenced. PASS WITH CONDITIONS, SCOPE LIMIT and NOT TESTED remain visible so the article does not claim more than was actually verified.
| Area | Check | Expected result | Status |
|---|---|---|---|
| Backup scope | Capture database, permanent directory, configuration, reverse proxy and TLS path | Backup scope is fully documented | PASS |
| Backup evidence | Document artifacts, return code, target path and timestamp | Backup is traceably evidenced | PASS |
| Restore basis | Restore to separate test system | Production system remains unchanged | PASS WITH CONDITIONS |
| Database | Restore PostgreSQL dump or snapshot | Wiki data exists in restore system | PASS WITH CONDITIONS |
| Attachments | Download known attachment and upload only in test space | File path and permissions work | PASS WITH CONDITIONS |
| Permissions and search | Check admin, user, search index and known content | User paths work after restore or upgrade | PASS WITH CONDITIONS |
| Production restore | Restore against production data | Not performed in this public pass | NOT TESTED IN THIS PASS |
Backup scope
- Check
- Capture database, permanent directory, configuration, reverse proxy and TLS path
- Expected result
- Backup scope is fully documented
- Status
- PASS
Backup evidence
- Check
- Document artifacts, return code, target path and timestamp
- Expected result
- Backup is traceably evidenced
- Status
- PASS
Restore basis
- Check
- Restore to separate test system
- Expected result
- Production system remains unchanged
- Status
- PASS WITH CONDITIONS
Database
- Check
- Restore PostgreSQL dump or snapshot
- Expected result
- Wiki data exists in restore system
- Status
- PASS WITH CONDITIONS
Attachments
- Check
- Download known attachment and upload only in test space
- Expected result
- File path and permissions work
- Status
- PASS WITH CONDITIONS
Permissions and search
- Check
- Check admin, user, search index and known content
- Expected result
- User paths work after restore or upgrade
- Status
- PASS WITH CONDITIONS
Production restore
- Check
- Restore against production data
- Expected result
- Not performed in this public pass
- Status
- NOT TESTED IN THIS PASS
Conclusion
XWiki becomes production-ready when technical installation, UI operation, permissions, backup and operations are tested together. That combination makes the series reproducible.
Commands are only half of the work. The decisive part is documented acceptance with real user paths in XWiki. The related XWiki series is shown directly below the article.










