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
- A server you run. See Manage a server.
Restore a backup
-
Stop the server with
commentware stop. The restore refuses while a server is running against the database it would replace. -
Run:
commentware db restore -
Type
yat “Restore this backup? [y/N]”. Pressing Enter cancels. Optional: pass-yin 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.
- Stop the server with
commentware stop, or accept that a copy taken while it is running may be mid-write. - Copy the SQLite file and the screenshots directory together.
Preview and run the purge
-
See exactly what would go, and delete nothing:
commentware purge --dry-run -
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
- Manage a server: start it again on the restored database.