Back up and restore a Postline server
On this page 1
The production scheduler runs BackupWorkspace at 02:00 server time. Set
POSTLINE_BACKUP_BUCKET on a production SQLite install to enable it. Give the
job credentials for that bucket and a recovery key separate from APP_KEY.
Postline's bucket limits the service credential to uploading objects and
verifying those uploads. Use a separate operator credential to list recovery
sets.
Each recovery set contains a transactionally consistent SQLite snapshot,
the uploaded media, and the original application key. The three files are
encrypted before leaving the server. A complete.json object appears only
after Postline confirms the queued images referenced by the snapshot are
present and S3 verifies all three uploads. The production bucket keeps daily sets
for 90 days and expires rehearsal sets after seven days.
To run the same job on the production scheduler host with its usual environment loaded:
./buddy schedule:run-one BackupWorkspace --in-process
The job logs the verified complete.json path. Search for BackupWorkspace
in the scheduler log if a run fails.
Recover onto a fresh install
-
With an S3 operator credential, choose the newest completed production set. Substitute your bucket and the selected directory in the second command.
aws s3 ls s3://YOUR_BUCKET/snapshots/ --recursive | awk '$4 ~ /\/complete\.json$/ {print $4}' | sort | tail -1 aws s3 cp s3://YOUR_BUCKET/snapshots/SELECTED_SET/ ./downloaded-postline/ --recursive -
Load the recovery key through your secret store as
POSTLINE_BACKUP_RECOVERY_KEY. On the Mac that provisioned Postline's bucket, the restore tool can also readrecovery-keyfrom thepostline-production-backupsKeychain service. Run the restore tool on a machine with room to decrypt and expand the media archive.bun scripts/restore-workspace.ts ./downloaded-postline ./recovered-postlineThe output path must be new. The tool checks the encrypted files against the manifest, authenticates them during decryption, checks SQLite, and extracts the media. The output contains
postline.sqlite,media/, andapp-keyin a private directory. -
Before starting the replacement server, place the database and media in its
DB_DATABASE_PATHandPOSTLINE_MEDIA_DIR. Install the recoveredapp-keyasAPP_KEYin its secret store. Keep that value across upgrades so Postline can open the encrypted network sign-ins in the database. -
Start the replacement web and API services with the scheduler disabled. Sign in and enable Settings > General > Pause scheduled publishing. Check that the workspace opens and a queued image loads. In
/api/postline/health, verify thatdatabaseandmigrationsboth reportokwhile the scheduler is stopped. Check the upgrade guide before opening an older backup with newer Postline code. -
Stop the original scheduler before starting the replacement scheduler. Review Queue > Needs attention and the schedule on the replacement. Verify that its health endpoint reports the scheduler as
ok, then resume scheduled publishing in Settings when ready.