# Upgrading and rolling back An upgrade is a new image on the same `/config` volume. The first time a new version starts, it brings the database up to date with its migrations, and those only go forward. So getting back to the previous version always means two things together: the previous **image**, and the **database as it was before the upgrade**. This page is how to do both. ## Before you upgrade Nothing is required — the server keeps its own copy of the database at every upgrade (next section). Two things are still worth a minute: - **Take a full backup of your own** if you haven't lately: **Control panel → Maintenance → Backup → Full backup**, then download it. The automatic copy is the database alone and sits on the same disk as the database; a full backup also carries the two-factor key and the cover images, and a downloaded one survives the disk. - **Decide what you follow.** The Unraid template and the compose file use `:latest`, which moves with every release. Pin a version (below) if you'd rather choose when to upgrade. ## The automatic pre-upgrade copy When a version starts that isn't the one that last ran this database, the server writes a copy of the database **before** that version's migrations touch it. It records which version last ran in the database itself; an install from before that record existed (anything older than 4.0.0) counts as an upgrade, so the first upgrade to 4.0.0 gets a copy too. - **What it is.** A consistent snapshot of the database file, taken with SQLite's `VACUUM INTO` — including anything still in the write-ahead log. It is the database only: no cover images and no `mfa.key`. On the same install that's all it needs — the key doesn't change between versions, so the copy still reads with the key you have. - **Where it goes.** It is written beside the database first (`/config/db/isputnik.sqlite.pre-upgrade`), and once the server is up it moves into the backup folder as `isputnik--