From bebad2d8141b2c77b4edbc211697373bb8d7af95 Mon Sep 17 00:00:00 2001 From: Ludovic Ortega Date: Wed, 15 Jan 2025 09:37:34 +0100 Subject: [PATCH] chore(docs): add documentation about which files/data should be back up (#1254) * chore(docs): add documentation about which files/data should be back up Signed-off-by: Ludovic Ortega * fix: backups category.json Signed-off-by: Ludovic Ortega * fix: postgresql documentation Signed-off-by: Ludovic Ortega * fix: database backup command Signed-off-by: Ludovic Ortega * fix: moved backup to a single page Signed-off-by: Ludovic Ortega * fix: postgresql options (replace dbname by port) Signed-off-by: Ludovic Ortega * fix: remove lost+lost folder --------- Signed-off-by: Ludovic Ortega --- docs/using-jellyseerr/backups.md | 93 ++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 docs/using-jellyseerr/backups.md diff --git a/docs/using-jellyseerr/backups.md b/docs/using-jellyseerr/backups.md new file mode 100644 index 000000000..47224b228 --- /dev/null +++ b/docs/using-jellyseerr/backups.md @@ -0,0 +1,93 @@ +--- +title: Backups +description: Understand which data you should back up. +sidebar_position: 4 +--- + +# Which data does Jellyseerr save and where? + +## Settings + +All configurations from the **Settings** panel in the Jellyseerr web UI are saved, including integrations with Radarr, Sonarr, Jellyfin, Plex, and notification settings. +These settings are stored in the `settings.json` file located in the Jellyseerr data folder. + +## User Data + +Apart from the settings, all other data—including user accounts, media requests, blacklist etc. are stored in the database (either SQLite or PostgreSQL). + +# Backup + +### SQLite + +If your backup system uses filesystem snapshots (such as Kubernetes with Volsync), you can directly back up the Jellyseerr data folder. +Otherwise, you need to stop the Jellyseerr application and back up the `config` folder. + +For advanced users, it's possible to back up the database without stopping the application by using the [SQLite CLI](https://www.sqlite.org/download.html). Run the following command to create a backup: + +```bash +sqlite3 db/db.sqlite3 ".backup '/tmp/jellyseerr_db.sqlite3.bak'" +``` + +Then, copy the `/tmp/jellyseerr_dump.sqlite3.bak` file to your desired backup location. + +### PostgreSQL + +You can back up the `config` folder and dump the PostgreSQL database without stopping the Jellyseerr application. + +Install [postgresql-client](https://www.postgresql.org/download/) and run the following command to create a backup (just replace the placeholders): + +:::info +Depending on how your PostgreSQL instance is configured, you may need to add these options to the command below. + + -h, --host=HOSTNAME database server host or socket directory + + -p, --port=PORT database server port number +::: + +```bash +pg_dump -U -d -f /tmp/jellyseerr_db.sql +``` + +# Restore + +### SQLite + +After restoring your `db/db.sqlite3` file and, optionally, the `settings.json` file, the `config` folder structure should look like this: + +``` +. +├── cache <-- Optional +├── db +│ └── db.sqlite3 +├── logs <-- Optional +└── settings.json <-- Optional (required if you want to avoid reconfiguring Jellyseerr) +``` + +Once the files are restored, start the Jellyseerr application. + +### PostgreSQL + +Install the [PostgreSQL client](https://www.postgresql.org/download/) and restore the PostgreSQL database using the following command (replace the placeholders accordingly): + +:::info +Depending on how your PostgreSQL instance is configured, you may need to add these options to the command below. + + -h, --host=HOSTNAME database server host or socket directory + + -p, --port=PORT database server port number +::: + +```bash +pg_restore -U -d /tmp/jellyseerr_db.sql +``` + +Optionally, restore the `settings.json` file. The `config` folder structure should look like this: + +``` +. +├── cache <-- Optional +├── logs <-- Optional +└── settings.json <-- Optional (required if you want to avoid reconfiguring Jellyseerr) +``` + +Once the database and files are restored, start the Jellyseerr application.