Wikibase Suite (WBS) stores the parts that make your instance unique in two places: service data in Docker volumes, and configuration in the config directory and .env file. The procedures below explain how to back up each and how to restore service data when recovering from a failed upgrade or reset.
WBS stores service data in the following Docker volumes:
wikibase-image-data: MediaWiki image and media file uploadsmysql-data: MediaWiki/Wikibase MariaDB raw databasewdqs-data: Query Service raw databaseelasticsearch-data: OpenSearch raw databasequickstatements-data: QuickStatements data and generated OAuth binding for this MediaWiki instancetraefik-letsencrypt-data: Traefik SSL certificates generated by Let’s EncryptTo back up these data volumes:
If you have not already, log in to your server and change to your WBS directory.
Create a backup directory one level above the directory from which you operate WBS, shut down the instance, and dump the contents of all Docker volumes into .tar.gz files there.
mkdir -p ../backup
docker compose down
for v in \
wbs-deploy_wikibase-image-data \
wbs-deploy_mysql-data \
wbs-deploy_wdqs-data \
wbs-deploy_elasticsearch-data \
wbs-deploy_quickstatements-data \
wbs-deploy_traefik-letsencrypt-data \
; do
docker run --rm --volume $v:/backup debian:12-slim tar cz backup > ../backup/$v.tar.gz
done
If you are backing up before an update, reset, or migration, return to that procedure and leave the services stopped. Otherwise, start WBS again:
docker compose up -d
WBS configuration is contained in the following files:
.env: installation settings and credentialsconfig/LocalSettings.php: user-owned MediaWiki and Wikibase configurationconfig/InstanceSettings.php: WBS-managed instance configuration and
secretsconfig/Extensions.php: optional instance-specific extension configurationconfig/extensions/: instance-specific extension codeconfig/wikibase-php.ini: PHP configurationconfig/wdqs-frontend-config.json: Query Service frontend configurationconfig/traefik-dynamic.yml: web routing configurationTo back up your configuration:
If you have not already, log in to your server and change to your WBS directory.
Copy the config directory and .env file into the same backup directory.
mkdir -p ../backup/config
cp -a ./config/. ../backup/config/
cp -a ./.env ../backup/.env
Keep this backup as a reference when resetting or upgrading. The .env file and configuration may contain plaintext passwords and other secrets, so store the backup directory securely. Do not restore old generated configuration files wholesale after reset; manually reapply your local changes to the new files created during reset.
If you have not already, log in to your server and change to your WBS directory.
Shut down the instance and populate the Docker volumes with data from the ../backup directory. Only restore these backups when recovering from a failed upgrade or reset.
Warning: the restore commands remove the existing Docker volumes before restoring the backup files.
docker compose down
for v in \
wbs-deploy_wikibase-image-data \
wbs-deploy_mysql-data \
wbs-deploy_wdqs-data \
wbs-deploy_elasticsearch-data \
wbs-deploy_quickstatements-data \
wbs-deploy_traefik-letsencrypt-data \
; do
docker volume rm $v 2> /dev/null
docker volume create $v
docker run -i --rm --volume $v:/backup debian:12-slim tar xz < ../backup/$v.tar.gz
done
If another procedure directed you to restore a backup, return to that procedure after the restore is complete. Otherwise, start WBS again:
docker compose up -d