Putting the old Docker tag back looks like a rollback, but Docker only replaces the app. If the newer release has already migrated the database, the old release opens that newer database exactly as it was left.
I checked what happened with 15 popular self-hosted apps that run as a single container with SQLite. Ten old versions started on the newer database. Four refused to start. Audiobookshelf was the odd one out: it reversed the newer migration before starting.
The most misleading result came from Linkding. The old version started, passed its health check and saved bookmarks, but trying to save a new bundle returned a server error.
For nine apps, I started the old release on a fresh Docker volume, upgraded the app, then put the old tag back. For the other six, I read the migration and startup code to see whether an old release would reject a database with newer migrations. The arrows below go from the newer release back to the older one.
Ten started on the newer database:
- Vaultwarden
1.37.5 --> 1.35.8started without a warning (tested in Docker). - Linkding
1.46.0 --> 1.45.0started and said "No migrations to apply" (tested in Docker). - Navidrome
0.65.0 --> 0.64.2started and said "no migrations to run" (tested in Docker). - Grafana
13.3.0 --> 13.2.0started after skipping all 719 migrations it knew (tested in Docker). - Uptime Kuma
2.5.12 --> 2.5.0warned about a possible downgrade, then started (tested in Docker). - n8n would start because its migration runner doesn't reject unknown migrations (checked in source).
- Pi-hole FTL
6.7 --> 6.6.2would start but switch off its long-term query history (checked in source). - Jellyfin
12.0 --> 10.11would start because its migration runner doesn't reject unknown migrations (checked in source). - PhotoPrism
261029 --> 260919would start because its migration runner doesn't reject unknown migrations (checked in source). - Actual
26.12.0 --> 26.11.0would start because that schema change was designed for older versions (checked in source).
Four wouldn't start:
- Gitea
1.27 --> 1.26refused, but its standard container exited with code 0 (tested in Docker). - Memos
26.11.3 --> 26.11.0refused and exited with code 1 (tested in Docker). - Mealie
3.30.0 --> 3.29.0crashed on an unknown migration and exited with code 3 (tested in Docker). - Trilium
0.107.0 --> 0.106.1would refuse withwrong_db_version(checked in source).
One put the database back:
- Audiobookshelf
2.35.0 --> 2.34.0reversed the newer migration, then started (tested in Docker).
Each Docker test used a fresh database in a container with network access disabled. I performed one upgrade and one rollback per app, but an upgrade could skip patch releases. Vaultwarden, for example, went from 1.35.8 straight to 1.37.5.
Linkding is healthy until you save a bundle
Linkding 1.46.0 added "shared" and "unread" filters to bundles, which are its saved searches. Those filters needed two new columns in the bundles table. One part of the Django migration looks harmless:
migrations.AddField( model_name="bookmarkbundle", name="filter_shared", field=models.CharField( choices=[("off", "All"), ("yes", "Shared"), ("no", "Unshared")], default="off", max_length=3, ), ), The default="off" value looks as though it should protect older releases, but it only helps while Django applies the migration. The final SQLite column is "filter_shared" varchar(3) NOT NULL with no database default.
Linkding 1.45.0 doesn't know that filter_shared exists, so the old code omits the column when it inserts a bundle. SQLite rejects the insert because the missing value isn't allowed.
I put the same volume through 1.45.0, 1.46.0 and 1.45.0 again, then used the web interface after each start:
old new back health 200 200 200 new bundle 302 302 500 new bookmark 302 302 302 IntegrityError: NOT NULL constraint failed: bookmarks_bookmarkbundle.filter_shared After the rollback, Linkding's health check still returned 200. Existing bundles loaded, and a new bookmark saved successfully. Only the "New bundle" button failed, so anyone who didn't use bundles could miss the damage for quite a while.
The same failure can affect any Django app that adds a required field with default but without null=True. Since Django 5.0, developers can use db_default when the database itself needs to supply the value. A plain default doesn't do that.
Why the old version doesn't notice
Most migration tools in these apps only compare the migrations bundled with the running version against the migrations recorded in the database. If a bundled migration is missing from the database's records, the tool runs that migration.
A migration that exists only in a newer release isn't in the old release's list, so the old migration tool has nothing to compare. The database can record migrations that the old release has never heard of, and startup still succeeds.
Navidrome showed the problem neatly. After I rolled back to 0.64.2, its database was six migrations ahead. Navidrome still logged goose: no migrations to run. current version: 20261127164354 and started. That version number belonged to one of the six migrations missing from 0.64.2.
Grafana behaved much the same way. Version 13.2.0 recognised 719 migrations, saw that all 719 were already recorded, and skipped them. The database also contained nine migration IDs from 13.3.0, but the old migrator ignored those unknown IDs.
Whether the old app works after startup depends on what the newer migrations changed. Four of Vaultwarden's five newer migrations added columns to existing tables, and each column was either nullable or had a database default. The fifth migration added a new archives table, which the old code didn't use. I checked the useful paths too: rolled-back Vaultwarden 1.35.8 created an account, logged in, saved an item and synced against the 1.37.5 database.
Uptime Kuma was the only app I ran that noticed the missing migration files but continued anyway. Its migration library called the migration directory corrupt, then Uptime Kuma warned that I might be downgrading and started. The warning only appeared in docker logs.
Pi-hole logs a database version error and switches off the long-term query database, but DNS continues working.
Gitea refuses, then Docker calls it a success
Gitea gave the clearest refusal:
Migration Error: Your database (migration version: 343) is for a newer Gitea, you can not use the newer database for this old Gitea release (331). Gitea will exit to keep your database safe and unchanged. The Gitea process exits with code 1. In the standard gitea/gitea image, however, Gitea runs under the s6 process supervisor. When Gitea stops, s6 shuts the container down cleanly and returns code 0. Docker therefore treats the failed startup as a successful exit.
I ran the same rollback under each Docker restart policy for 45 seconds:
--restart no Exited (0) 0 restarts --restart on-failure Exited (0) 0 restarts --restart unless-stopped Restarting 7 restarts --restart always Up 4 seconds 7 restarts With unless-stopped, or the always policy in Gitea's own Compose examples, the container restarts every few seconds. With on-failure, the container stays off because Docker received a zero exit code. A monitor that only treats non-zero container exits as crashes won't report the failed Gitea startup.
Gitea's rootless image doesn't use s6, so that image passes Gitea's exit code 1 back to Docker. Memos also refuses to start and returns code 1. Mealie avoids opening the newer database by accident: Alembic can't find the newer migration recorded in the database, so startup ends with a traceback and code 3.
A real rollback needs the old data too
Changing the tag only restores the old application code. To restore the old database, you need a copy taken before the upgrade.
I tested the following commands with Linkding's standard named volume. First, stop Linkding and copy the whole volume before changing the tag:
docker compose stop linkding docker run --rm -v linkding_data:/data -v "$PWD":/backup alpine \ tar czf /backup/linkding-1.45.0.tgz -C /data . If the upgrade goes wrong, stop Linkding, change the Compose file back to 1.45.0, then empty the volume and restore the copy. Emptying the volume first matters because otherwise files created by the newer release remain mixed into the old data.
docker compose stop linkding docker run --rm -v linkding_data:/data -v "$PWD":/backup alpine \ sh -c 'find /data -mindepth 1 -delete && tar xzf /backup/linkding-1.45.0.tgz -C /data' docker compose up -d linkding After I restored the volume, Linkding 1.45.0 loaded the bundle I had made before upgrading and created another one without an error. Anything saved after the backup was gone, as you'd expect.
Two apps designed for the problem
Audiobookshelf copies new migration files into the persistent /config folder during an upgrade. When Audiobookshelf 2.34.0 opened the database from 2.35.0, the old release found the newer migration file in /config, ran its down step, removed the two new columns and then started. Audiobookshelf was the only app in the group that reversed a migration automatically.
Actual takes a different approach. Since September 2026, its migration rules have only allowed schema changes that older versions can use: new tables, nullable columns, or required columns with a database DEFAULT. Renaming or removing a column isn't allowed, and a CI test checks every new migration against those schema rules.
Actual added the rules so devices on different releases could keep syncing. For the 26.12.0 migration I checked, the rule also made a rollback to 26.11.0 safe: the new required column had a database default, so the old release could still write rows. Actual's README warns that the test can't make data migrations safe, because an INSERT or UPDATE can still change values that an old release doesn't understand.
More like this on blog.peng.ly

