---
title: "What the server deletes on its own"
description: "The backup a migration writes before it changes the database, and the one job that deletes comments without being asked."
---

> Documentation Index
> Fetch the complete documentation index at: https://commentware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# What the server deletes on its own

Your comments are a file on your machine. There is no replica, no operator and
nobody to call — so the two places the server touches that file without being
asked are the two it is most careful about: a migration, which backs the file up
first, and the _retention purge_, which deletes old resolved threads.

## Migrations back themselves up first

An upgrade that changes the database's shape writes a backup **before** it runs,
and refuses to run if it cannot. No backup, no migration.

The backup is a directory next to the database — `<database>.pre-migration-backup`
— holding the database **and** the screenshots together. A restored database
pointing at screenshots that did not come back is silent loss, so the two are never
separated.

`commentware start` prints where the backup went on any start that migrates.

## The retention purge

**It deletes resolved threads past the retention window, and their
screenshots.** An open thread on a page is never touched, at any age.

This is the only thing in Commentware that deletes somebody's data without being
asked, which is why it is worth reading before it runs.

The window is `resolved-purge-days`, 30 by default. Setting it to `0` keeps
every resolved thread.

A thread brought in by an import counts from the later of the time it was
resolved and the time it was imported, so an old resolved thread is not
deleted soon after it arrives.

**It also ends idle document reviews, open threads included.** A document an
agent opened for comment is a review, and when nobody has revised it or
commented on it for `bundle-idle-days`, 7 by default, the purge ends it: the
document, its images, and every comment on it are deleted. `0` keeps every
review until somebody ends it. Document reviews are experimental, so
`bundle-idle-days` may change or be removed in any release, with no notice
first.

It runs once when the server starts and every six hours after that. Starting is
in there because the common case for this product is a laptop, and a timer-only
job never fires on a machine that gets closed.

## Next steps

- [Back up and restore](/docs/server/data/): put a backup back, take your own,
  and preview the purge before it runs.