Upgrade to v8
Move a v7 instance to OpenPost v8, which runs on PostgreSQL, and keep your SQLite data, secrets and a way back.
OpenPost v8 stores its data in PostgreSQL 17 only. The official image includes a PostgreSQL, so a one-container install keeps working with the same /data mount, and your v7 SQLite data imports the first time v8 starts.
What you need
v8 brings the database up to date itself: on the first start it applies the v7 changes your release had not reached yet, then the v8 ones. This holds for SQLite files and for PostgreSQL databases that v7 created. A database from before v7.0.0 makes v8 explain this and exit without changing anything: start v7.45.0 once against it, wait until it is serving, stop it, then start v8.
Upgrade
Stop OpenPost and back up.
Run
docker compose stop openpost, then copydataand.envsomewhere safe. Note the image tag you run today.Keep your secrets.
Keep the same
OPENPOST_JWT_SECRETandOPENPOST_ENCRYPTION_KEY. Changed values make saved provider credentials unreadable or sign everyone out. v7 installs already pass them, so do not remove them. If they are missing or weak, OpenPost replaces them on the first start; see weak secrets from v7.Simplify your Compose file.
Remove
user: 0:0and theOPENPOST_DATABASE_DRIVERandOPENPOST_DATABASE_PATHlines. Keep the/datamount.OPENPOST_PUBLIC_URLandOPENPOST_MEDIA_URLcan go when they matchOPENPOST_APP_URL.Start v8.
Set the image to a v8 release tag from GitHub Releases, then run
docker compose pull openpostanddocker compose up -d openpost.Verify the import.
Follow the logs with
docker compose logs -f openpost, then check readiness and your data.
What the import does
On first start, when the PostgreSQL database is empty and a SQLite file exists, OpenPost:
- Checks that its encryption key decrypts a sample of every kind of secret stored in the SQLite file. A weak key that decrypts is fine; OpenPost replaces it after the import (see weak secrets).
- Copies a backup of the SQLite file to
openpost.db.pre-v8-backupnext to it. - Creates the schema and copies every table in one transaction.
- Verifies the row count of every table against the SQLite file.
- Renames the SQLite file to
openpost.db.migrated-to-postgresonly after it succeeds.
If anything fails, OpenPost rolls back and leaves the SQLite file untouched. The source defaults to /data/db/openpost.db. Set OPENPOST_DATABASE_PATH only when your v7 file lives elsewhere.
Weak secrets from v7
v7 started without OPENPOST_JWT_SECRET or OPENPOST_ENCRYPTION_KEY, or with a value copied from a template or install guide, and then protected nothing: anyone could sign in as any account and read the stored provider tokens. v8 treats a secret as weak when it is unset, shorter than 32 characters, or a published example such as change-this-..., REPLACE-WITH-... or a value from a community guide, and fixes it on the first start:
- Encryption key. OpenPost decrypts a sample of every kind of stored secret with the weak key. When that works, it generates a new key, stores it in
/data/secrets/instance.json, re-encrypts every stored secret in one transaction and records the new key. The log shows aWARNINGthat says how many values it re-encrypted. If any sample does not decrypt, OpenPost changes no secret and refuses to start; setOPENPOST_ENCRYPTION_KEYto the key that encrypted the data and start again. On a first v8 start this check reads the SQLite file before the import, so a refused start imports nothing and leavesopenpost.dbin place for v7 or the next attempt. - JWT secret. OpenPost generates a new secret, stores it in the same file and signs out every session once. Everyone signs in again with their password. Email verification and email change links sent before the upgrade stop working.
After the replacement the file wins over the weak value, so the next starts keep working while the old value is still in your Compose file or .env. Each start logs a warning until you remove it. Then back up /data/secrets/instance.json with your data: it now holds the only copy of the key. Instance backups made before the replacement carry the old key and are refused on restore, so make a new backup. Rolling back to v7 after the replacement leaves saved provider connections unreadable in v7.
Verify the import
curl -fsS http://localhost:8080/api/v1/readyreturns"status":"ready"and"database":"ok"./data/db/openpost.db.migrated-to-postgresexists and the originalopenpost.dbis gone.- You can sign in, a scheduled post is still scheduled, and a post with media shows its files.
- Connected accounts show no reconnect prompt, which confirms the encryption key is unchanged.
Roll back
The renamed file is a complete v7 database, so going back is safe while v8 has not become your only copy of new work.
Stop OpenPost.
Rundocker compose stop openpost.Restore the v7 file.
Rename
data/db/openpost.db.migrated-to-postgresback todata/db/openpost.db, or restore your backup ofdata.Pin v7 and start.
Set the image to the v7 tag you noted, or
ghcr.io/getopenpost/openpost:v7.45.0, and rundocker compose up -d openpost. Anything you created in v8 is not in the SQLite file. Posts that came due while v8 ran are still scheduled in the file, and v7 publishes them again as soon as it starts, even when v8 already published them.
If the import failed or v8 refused to start before it, for example because the encryption key did not decrypt the SQLite data, the SQLite file is untouched. Pin your v7 tag until you know why, and keep the logs. If v8 stopped after a completed import, the file was already renamed: rename it back as above before you start v7, or v7 starts with an empty database.
The latest tag
latest moves to v8 when it is released. A copied Compose file with only /data mounted keeps working, because the container imports your SQLite data and runs its own PostgreSQL. Pin a version tag if you want to choose when the upgrade happens, and record the tag with your backups.
Use an external PostgreSQL instead
To import into your own PostgreSQL, create an empty PostgreSQL 17 database as described in use your own PostgreSQL, set OPENPOST_DATABASE_URL and keep the SQLite file mounted at its v7 path. The same automatic import runs. You can also run it by hand, with --dry-run to check first:
openpost db import-sqlite --from /data/db/openpost.db --to "$OPENPOST_DATABASE_URL" --dry-run
openpost db import-sqlite --from /data/db/openpost.db --to "$OPENPOST_DATABASE_URL"A v7 backup ZIP restores into v8 through the same importer, from Settings → Advanced → Instance.