A backup is a copy of the database, which holds your settings, accounts, playlists, requests and history, plus the undo copies Library Management keeps so its changes can be put back. There is no backup schedule. DroppedNeedle makes one by itself only when a new version is about to change the database (a pre-upgrade backup). Make one by hand whenever you want a fresh copy.
What a backup holds#
| Data | In a backup? |
|---|---|
| Settings, accounts, playlists, requests, history | Yes: they are all in the database |
| Undo copies for Library Management | Yes, in the shared backups/undo folder |
The key file config/data_enc.key | No. Keep it with your backups: without it, the passwords and API keys stored in a backup can’t be read |
metadata-cache.db (provider answers) | No. It is fetched again when needed |
| Your music, the plugins folder, and other files in the cache folder (such as profile pictures and held downloads) | No. A backup copies only the database and the undo copies |
Make a backup#
Open the Backups settings#
Go to Settings › Backups. The pane reads “Copies of the database, settings included.” and “The newest 5 are kept.”
Press Back up now#
Result: a toast reads
Backed up:with the file name and size, and the backup tops the list. Each row shows its name, such aslibrary-1732400000000-0.db, then its date, size andSchemanumber.Check the backup#
Press Check on its row.
Result: the Check backup dialog reads
This backup can be restored.and lists each check with a tick or a cross. Checking reads the backup and changes nothing.Keep a copy of the backups folder and the key file#
Backups are written to the
backupsfolder beside the database:/app/cache/backupsin the container, sobackupsinside the host folder you mount at/app/cache. Copy the wholebackupsfolder, not only the.dbfiles, since the undo copies are inbackups/undo. Keepconfig/data_enc.keywith it.
Restore a backup#
Restoring is done on the host with the server stopped, never from the web UI. These commands are from Backups and restore, which also has the form for Unraid, Portainer and Synology, where you use docker run instead of Compose.
Stop the server#
bashdocker compose stop droppedneedledroppedneedleis the service name in the compose file. Use yours if it differs.Restore the backup into an empty folder#
Put the backup’s file name in place of
BACKUP.db:bashdocker compose run --rm droppedneedle droppedneedle-tool restore --backup /app/cache/backups/BACKUP.db --target-dir /app/cache/restoreddroppedneedle-tool checks the backup first and never replaces a file. It writes
library.dband the undo copies the backup names into the target folder.Move the restored database into place#
On the host, in the folder the server mounts at
/app/cache:bashcd /path/to/cache rm -f library.db-wal library.db-shm mv restored/library.db library.db cp -an restored/undo/. undo/The
-waland-shmfiles belong to the old database, so they go first. The restored file replaces the currentlibrary.db. Instead of moving it, you can pointLIBRARY_DB_PATHat/app/cache/restored/library.db.Check the key file#
config/data_enc.keymust be the key saved with this backup. A key from another server or another backup is refused.Start the server#
bashdocker compose up -d droppedneedleResult: DroppedNeedle starts on the restored database, with the settings, accounts and history it held.
Go back to the version you ran before an update
A database a newer version has migrated can’t be opened by the older image. Restore the backup taken before the update, then change the image tag back and start the container. Going back after a failed update has the steps.
Check it worked#
- After Back up now, the new file is at the top of Settings › Backups, and Check reports
This backup can be restored. - After a restore, the server starts and your settings, users and playlists are as they were when the backup was made.
If something went wrong#
Each heading below is the message DroppedNeedle shows.
Backup failed
The toast shows the server’s reason when it has one. A backup that fails its own checks is never put in place, and the backups you already had stay as they were. Check health and read the logs shows where to look.
Database in memory
The alert on Settings › Backups reads “It and its backups are lost on restart. Map /app/cache to a disk or pool path.” The cache folder is on tmpfs or ramfs. Copy the backups folder out while the container runs, then move /app/cache to a disk: Storage and permissions has the commands.
This backup cannot be restored.
The list under it names the check that failed, such as integrity-check or schema-version. Pick another backup from the list and press Check on it.
refusing restore into non-empty target
The target folder already holds files. Remove the old restored folder, or give --target-dir a new folder name.
the key file … is missing, but the database … already holds this server's data
The server refuses to start and changes nothing. Put back the data_enc.key saved with this database, in config. The same goes for “the key file … does not belong to the database …“. Only if that key is lost for good, see The key file for droppedneedle-tool reset-key --yes, which clears every stored password and API key.