Move qui to a new server
qui keeps its state in qui.db and config.toml. If you copy these files to the new host, qui starts there with the same instances, users, automations, and cross-seed configuration. You do not need a qBittorrent backup for this.
qui.db is the SQLite database that holds this data. qui keeps it in the data directory.
config.toml is the configuration file. It contains sessionSecret. qui makes the encryption key for stored passwords and API keys from that value. If you start with a new config.toml, qui cannot read those passwords and API keys.
Find the files
The config directory is the directory that contains the configuration file that qui uses. By default, it is:
| Install | Config directory |
|---|---|
| Linux or macOS | ~/.config/qui/ |
| Windows | %APPDATA%\qui\ |
| Docker | The host folder that you mount at /config |
Three cases change this:
- If you set
XDG_CONFIG_HOME, the default is$XDG_CONFIG_HOME/qui. - If a
config.tomlis in the directory where you start qui, qui uses that file. - If you start qui with
--config-dir, qui uses the path that you give. The path can be a directory that containsconfig.toml, or a.tomlfile with a different name. In the second case, copy that file.
The data directory is the config directory, unless you set one of these:
- The
dataDirvalue inconfig.toml - The
QUI__DATA_DIRenvironment variable - The
--data-dirflag
Environment variables
Environment variables override the values in config.toml. If you set QUI__SESSION_SECRET or QUI__SESSION_SECRET_FILE on the old host, set the same value on the new host. If the secret changes, qui cannot read the stored passwords and API keys.
Copy the other QUI__ environment variables that you set, for example QUI__DATA_DIR.
A variable that ends in _FILE names a file, for example QUI__SESSION_SECRET_FILE or QUI__DATABASE_PASSWORD_FILE. Copy each of these files to the new host. If a file has a new location, change the path in the variable.
Postgres
If you use Postgres, qui has no qui.db. The data stays in the Postgres database. Copy only config.toml, and skip the steps for qui.db below.
Make sure that the new host can connect to the same Postgres database. This guide does not move the Postgres database itself.
Copy the files
- Stop qui on the old host. If qui runs, the copy of
qui.dbcan be incomplete. - On the old host, copy
qui.dbfrom the data directory. Ifqui.db-walandqui.db-shmexist, copy them too. They can hold recent changes that are not inqui.dbyet. - On the old host, copy
config.tomlfrom the config directory. - Install qui on the new host. Use the installation, Docker, or Windows guide.
- Stop qui on the new host.
- In the data directory on the new host, delete
qui.db,qui.db-wal, andqui.db-shmif they exist. - Put the copied
qui.db,qui.db-wal, andqui.db-shmin the data directory on the new host. - Put
config.tomlin the config directory on the new host. - Start qui on the new host.
Log in with the user and password from the old host.
After the move
- If the address of qBittorrent changed, edit each instance and set the new URL.
- If the paths to your data changed, update the paths in cross-seed, automations, and orphan scan.
- If the new host needs a different host, port, or base URL, edit
config.tomlbefore you start qui. - If you want to keep your backups, copy the
backupsdirectory in the data directory. If you setbackupDir, copy that directory. - If you want to keep custom themes, copy the
themesdirectory in the config directory. If you setcustomThemesDir, copy that directory. - If you want to keep the tracker icons, copy the
tracker-iconsdirectory in the data directory.
Do not run qui on both hosts with the same database. If you do, both change your qBittorrent instances at the same time.