Skip to content

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/backups lists them, newest first.
  • POST /api/backups makes one now.

Stop Noct, replace the database with a backup, and start it again:

  1. Stop Noct (the tray app’s Quit, or systemctl stop noct, or stopping the container).
  2. In the data directory, delete noct.db-wal and noct.db-shm if they’re there, and copy the backup over noct.db.
  3. 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.