PotionUI Docs v0.3.0

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.

GuideWritten for v0.3.0
On this page

What to back up#

Paths are relative to the PotionUI folder, with the default settings.

WhatWhereWhy it matters
Databasestorage/db.sqliteAccounts, settings, history, sessions, tags, collections, preset and model assignments, plans and backends. Changed with POTIONUI_DB_PATH.
Encryption keystorage/secret.keyBeside the database. Decrypts every stored credential. Changed with POTIONUI_SECRET_KEY_FILE, or replaced by POTIONUI_SECRET_KEY.
Environment file.envYour overrides, if you made one.
Your own contentcontent/presets/local, content/plugins/local, content/automation/localPresets, plugins and automation templates you added. The shipped ones under marketplace come with the code.
Small storage filesstorage/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.
Mediastorage/uploads, storage/generationsEvery upload and every generated file.
Modelsmodels/ and any folders you addedLarge and downloadable again; see Models.

PotionUI backs up in three tiers, each containing the one before it:

TierWhat 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.
mediaThe zip, plus a mirror of your uploads and generations in a media folder beside it.
allThe 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.

The archive holds your encryption key

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#

  1. Open the Backups settings

    In Administration, System Settings, choose Backups.

  2. 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.

  3. Choose Backup now

    The backup runs in the background at the default tier.

    What you will see

    Backup 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.

POST/api/admin/backups/run
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#

Shellbackup
./potionui backup                              # config tier, to the Destination setting
./potionui backup --out /mnt/backups --tier media
./potionui backup --tier all                   # media plus the models folder
  • --out overrides the destination for this run.
  • --include-models adds the models mirror to --tier media, the same as --tier all.
  • --include-animated-thumbnails also 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:

cronnightly at 03:00
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.

  1. 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.

  2. Prepare and stop

    On a fresh installation, run ./potionui start once so it creates storage/, then ./potionui stop. Restore refuses to run while PotionUI is running.

  3. Check the plan

    --dry-run prints 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 media folder beside the archive; --media DIR points elsewhere.

  4. 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 see

    Restore 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#

  1. Back up the old machine

    Stop generating, then take a media backup, or all if you want the models folder too.

  2. Install the same or a newer version on the new machine

    Use the same install profile. Run ./potionui start once, then ./potionui stop.

  3. Copy and restore

    Copy the archive and its media folder across, keeping them side by side, and run ./potionui restore on the archive. If you keep the encryption key in POTIONUI_SECRET_KEY, it travels in .env when that file was backed up; otherwise set it on the new machine before starting.

  4. 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.

Backup & restore ↗