Back up and restore

Restoring after a failed migration, copying the database and its screenshots together, and checking the purge before it deletes anything.

Put back the backup a migration wrote, take your own copy, and see what the retention purge would delete before it does. Learn more about what the server deletes on its own.

Prerequisites

Restore a backup

  1. Stop the server with commentware stop. The restore refuses while a server is running against the database it would replace.

  2. Run:

    commentware db restore
  3. Type y at “Restore this backup? [y/N]”. Pressing Enter cancels. Optional: pass -y in step 2 to skip the question.

Somebody running this has had a migration fail on a database nobody else has a copy of, so the command does the checking they are in no position to do:

  • It opens the backup before touching anything, so a truncated file fails there rather than after it has replaced the live one.
  • It refuses a backup newer than this build understands.
  • It refuses while a server is running against the database it would replace.

It renames rather than deletes. It restores the screenshots with the database, and what it replaces moves aside — the database to <database>.replaced-by-restore, the screenshots directory to <blobs>.replaced-by-restore — so restoring the wrong thing is undoable.

Back it up yourself

Nothing here replaces an ordinary backup. Two paths matter: the SQLite file, and the directory of screenshots and attachments beside it. commentware where prints both without starting a server, the directory as blobs.

  1. Stop the server with commentware stop, or accept that a copy taken while it is running may be mid-write.
  2. Copy the SQLite file and the screenshots directory together.

Preview and run the purge

  1. See exactly what would go, and delete nothing:

    commentware purge --dry-run
  2. Optional: run it by hand rather than waiting for the next run:

    commentware purge

Run the preview after changing resolved-purge-days or bundle-idle-days, before finding out the other way. Learn more about settings.

Check that it worked

After a restore, what it replaced is beside the database as <database>.replaced-by-restore and <blobs>.replaced-by-restore. commentware purge --dry-run prints what the purge would delete, and nothing is gone.

Next steps

Documentation

Type to search…

↑↓ navigate↵ selectEsc close