| 1 | # PDS data migration |
| 2 | |
| 3 | The 2026-09-26 preview restore copied Zenith's three SQLite databases with SQLite's backup API and copied its blocks and actor keys without writing to Zenith. The restored stage passed SQLite integrity checks and HTTPS health. Source and stage had the same table and row counts: `account` 18/47, `sequencer` 3/76, and `did_cache` 3/5. The preview uses a separate hostname and disables PLC and crawlers, so it cannot validate public federation. |
| 4 | |
| 5 | For production, configure the new host's site domain as `paperclover.net` and verify PDS renders `at.paperclover.net`. Stop the old and new PDS instances, then run `STUDIO_DEPLOY_HOST=<new-host> STUDIO_DEPLOY_PORT=22 sh tools/import-pds.sh pds`. The importer requires both instances stopped, imports the existing JWT/admin/PLC and mail secrets, snapshots the destination, copies and verifies the data, and leaves the new instance stopped. Its snapshot name is printed for recovery. Start the new instance only after checking the account DID and handle against Zenith; switch public routing after its health and identity endpoints agree. The importer rechecks that Zenith did not restart during the copy. |
| 6 | |
| 7 | For a same-machine OS replacement, set `STUDIO_LEGACY_HANDOFF` to the [offline handoff](legacy-handoff.md) directory. The importer then reads the retained PDS SQLite files and `.env` from the new host's mounted old apps dataset, without old Docker. Its SQLite backup operation was checked read-only against all three old databases. |