Legacy syncing Wiki.js database to another dev environment
Legacy notes for the old Wiki.js deployment, kept for reference after the wiki migration to llm-wiki/.
One-time setup on the other machine
- Clone the repo (or ensure it has the same
dev/wikijslayout). - In
dev/wikijs: copy.env.exampleto.env, setDB_PASSif you like (default is fine). - Start the stack:
docker compose up -d. - Complete the Wiki.js setup wizard once at http://localhost:3000 (it will be replaced when you restore).
Sync steps
1. On this machine (source — the one with the DB you want to copy)
From the repo root or dev/wikijs:
cd dev/wikijs
./scripts/dump-for-sync.sh
This creates a timestamped dump in dev/wikijs/backups/, e.g. wiki-db-sync-20260217-143022.sql. The script excludes the assetData table by default (same as prod pull) to keep the dump small; page content and structure are included.
2. Copy the dump to the other machine
Use scp (replace with the other machine’s user, host, and path):
scp dev/wikijs/backups/wiki-db-sync-*.sql otheruser@otherhost:/path/to/buckyverse.org/dev/wikijs/backups/
Or use a shared drive, USB, etc. — the other side only needs the .sql file in (or next to) their dev/wikijs tree.
3. On the other machine (target)
cd dev/wikijs
./scripts/restore-from-backup.sh backups/wiki-db-sync-20260217-143022.sql
Use the actual filename you copied. If you put the dump in backups/, you can also run ./scripts/restore-from-backup.sh with no arguments to restore the latest wiki-db-*.sql in backups/.
Wiki.js is stopped during restore and started again afterward. Open http://localhost:3000 on the other machine to confirm.
Optional: include assetData
If you need uploaded assets (images, etc.) in sync and the assetData table is not too large, on the source machine set in dev/wikijs/.env:
SYNC_DUMP_EXCLUDE_TABLE_DATA=
Then run ./scripts/dump-for-sync.sh again. The dump will include all tables and will be larger.
Related
- wikijs-local-dev.md — local dev setup and pull/push to production.
dev/wikijs/scripts/dump-for-sync.sh— creates the sync dump.dev/wikijs/scripts/restore-from-backup.sh— restores from a dump (used by pull-from-prod and for sync).