Backups
Noct copies its database to <data dir>/backups once a day (checked every
hour, so a machine that’s only on for a while still gets them) and keeps the
last seven. The database is what can’t be fetched again: matches and edits made
by hand, and, later, watch history and playlists. Images and everything TMDB
says are fetched again if they’re lost.
A backup is a complete SQLite database named noct-YYYYMMDD-HHMMSS.db, made
while Noct carries on. It includes the TMDB API key if one was saved through
Noct, so keep the folder as private as the database.
Starting a newer version of Noct on an older database makes one more first, from before the database is changed. It’s named like the others and counts as one of the seven. If it can’t be made (the disk is full, say) Noct doesn’t upgrade the database and doesn’t start, rather than change what it couldn’t save. To go back to the older version, restore that backup (below) and start the older version.
GET /api/backupslists them, newest first.POST /api/backupsmakes one now.
Restoring
Section titled “Restoring”Stop Noct, replace the database with a backup, and start it again:
- Stop Noct (the tray app’s Quit, or
systemctl stop noct, or stopping the container). - In the data directory, delete
noct.db-walandnoct.db-shmif they’re there, and copy the backup overnoct.db. - Start Noct.
The same steps put a backup onto a fresh install: start with an empty data
directory that holds just the copied noct.db.
Where the data directory is: ./data for cargo run -p noct-server (or
NOCT_DATA_DIR), /data in the Docker image, and the OS’s app-data folder
for the tray app.