Backup and restore
PotionUI keeps your work in a database, an encryption key and several folders on disk, and a useful backup gathers all of them at one moment. This guide covers what to back up, how to take a backup from the browser or the command line, how to restore it, and how to move an installation to another machine.
On this page
What to back up#
Paths are relative to the PotionUI folder, with the default settings.
| What | Where | Why it matters |
|---|---|---|
| Database | storage/db.sqlite | Accounts, settings, history, sessions, tags, collections, preset and model assignments, plans and backends. Changed with POTIONUI_DB_PATH. |
| Encryption key | storage/secret.key | Beside the database. Decrypts every stored credential. Changed with POTIONUI_SECRET_KEY_FILE, or replaced by POTIONUI_SECRET_KEY. |
| Environment file | .env | Your overrides, if you made one. |
| Your own content | content/presets/local, content/plugins/local, content/automation/local | Presets, plugins and automation templates you added. The shipped ones under marketplace come with the code. |
| Small storage files | storage/ | llm.yml, saved prompts, segment categories and templates, and the folders for avatars, profiles, preset media, inspirations, LoRA datasets, sprite sheets, the video editor and remote imports. |
| Media | storage/uploads, storage/generations | Every upload and every generated file. |
| Models | models/ and any folders you added | Large and downloadable again; see Models. |
PotionUI backs up in three tiers, each containing the one before it:
| Tier | What it takes |
|---|---|
config (default) | One zip: the database, secret.key, .env if present, your local presets, plugins and automation, and the small storage files and folders. |
media | The zip, plus a mirror of your uploads and generations in a media folder beside it. |
all | The media tier, plus a mirror of the built-in models folder. |
Left out of every tier: storage/tmp, storage/chromadb, storage/logs, storage/model_hash_cache.json, storage/settings.json (the database holds the real settings), any *.bak-* file and the SQLite -wal and -shm files. The database is copied with SQLite's VACUUM INTO, which gives a consistent snapshot even while the app writes; a plain copy of db.sqlite can miss recent changes.
Every backup contains secret.key, the key that encrypts every stored credential: provider API keys, backend settings, LLM keys. Anyone who has the archive can decrypt all of them. Store backups somewhere access-controlled, never in a shared or public place, and treat them with the same care as the key itself.
Back up from the browser#
-
Open the Backups settings
In Administration, System Settings, choose Backups.
-
Set where and how much
Destination is a folder, relative to the PotionUI folder or absolute; it starts as
backups. It is created when you save, and the panel says if it cannot be written to. Retention is how many archives to keep, 7 at first; 0 keeps all. Default tier is what a backup takes. Save. -
Choose Backup now
The backup runs in the background at the default tier.
What you will seeBackup finished with its size, and the new archive in the Archives list with the app version that made it. You can delete an archive from the list.
Under Scheduled backups the panel prints a cron line for the same backup, ready to copy. The panel and the command line read the same destination, so both write to the same folder. Retention prunes archives only; the media mirror beside them is never pruned.
Over HTTP
The same panel actions are administrator routes. POST /api/admin/backups/run starts a backup, at the default tier or the tier you send; GET /api/admin/backups/job reports the run in progress; GET /api/admin/backups returns the settings, the archives, the media mirror and the cron line. No MCP tool takes backups.
curl -X POST http://localhost:26730/api/admin/backups/run \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "tier": "media" }'Back up from the command line#
./potionui backup # config tier, to the Destination setting ./potionui backup --out /mnt/backups --tier media ./potionui backup --tier all # media plus the models folder
--outoverrides the destination for this run.--include-modelsadds the models mirror to--tier media, the same as--tier all.--include-animated-thumbnailsalso copies the looping video previews (*_animated.webp). They are skipped by default because PotionUI rebuilds them from the videos.
The archive is named potionui-backup-<YYYYMMDD-HHMMSS>.zip and carries a manifest.json. The command exits 0 on success and 1 when it is refused or fails. On native Windows, use .\potionui.cmd backup.
The media mirror is a plain folder, not a zip, and it is incremental: a file whose size and modification time already match is skipped, so a nightly run copies only what changed. It never deletes anything; a generation you delete in PotionUI stays in the mirror until you prune it yourself. A nightly entry covering the database and media is enough for most installations:
0 3 * * * /path/to/potionui backup --out /mnt/backups --tier media
Restore#
Restore runs from the command line with PotionUI stopped; there is no restore button.
-
Use the same or a newer version
Check out the same PotionUI version the backup came from, or a newer one. A backup made by a newer version than the code you have is refused.
-
Prepare and stop
On a fresh installation, run
./potionui startonce so it createsstorage/, then./potionui stop. Restore refuses to run while PotionUI is running. -
Check the plan
--dry-runprints what would happen and checks the archive, writing nothing.Shellrestore./potionui restore /path/to/potionui-backup-20261111-030000.zip --dry-run ./potionui restore /path/to/potionui-backup-20261111-030000.zip
Restore looks for the media mirror in a
mediafolder beside the archive;--media DIRpoints elsewhere. -
Start again
Run
./potionui start. Restore does not run database migrations; the normal start does, which is why an older backup restores onto newer code.What you will seeRestore reports that it checked every generation file, thumbnail and upload the restored database refers to. Missing animated previews are counted, since they are rebuilt. A missing original file is listed with its generation id.
Nothing restore replaces is deleted. The previous database becomes db.sqlite.pre-restore-<timestamp>, and the previous key and each replaced folder get a .pre-restore-<timestamp> name too. Delete them yourself once you are happy with the result. Media files already present are not copied again.
Models#
Model files are left out unless you ask for them, because they are large and can be downloaded again: the database keeps each model's checksum to find the same file. --tier all mirrors the built-in models folder only; folders you added in Administration, Models, Folders are never copied. Restore does not put models back either. Copy the mirror across by hand, or let the models download again.
Move to another machine#
-
Back up the old machine
Stop generating, then take a
mediabackup, orallif you want the models folder too. -
Install the same or a newer version on the new machine
Use the same install profile. Run
./potionui startonce, then./potionui stop. -
Copy and restore
Copy the archive and its
mediafolder across, keeping them side by side, and run./potionui restoreon the archive. If you keep the encryption key inPOTIONUI_SECRET_KEY, it travels in.envwhen that file was backed up; otherwise set it on the new machine before starting. -
Bring the models and start
Copy model files across or let them download again, start PotionUI, and sign in with your existing accounts. If a model folder now lives at a different path, relink it in Administration, Models, Folders; nothing is hashed again.
With S3 storage#
When media storage is set to S3, the media and all tiers are refused: your media already lives in the bucket, so use the bucket's own versioning. Keep running the config tier, which still covers the database and your credentials. Backups taken before the S3 secret key was stored encrypted contain it in plain text; if those archives are not tightly held, rotate the key with your S3 provider.
In Docker#
In the Docker image the database, key, settings and media live in the storage volume and models in the models volume. The Backups panel works there, but a relative destination resolves inside the container, under /app, outside both volumes, and is lost with the container. Mount a separate volume or host folder for backups and set Destination to its path inside the container.