Jellyfin Forum
Jellyfin Backups & Migration - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Development (https://forum.jellyfin.org/f-development)
+--- Forum: Feature Requests (https://forum.jellyfin.org/f-feature-requests)
+--- Thread: Jellyfin Backups & Migration (/t-jellyfin-backups-migration)



Jellyfin Backups & Migration - LeviSnoot - 2023-09-19

Basing this thread off the following Fider request: https://features.jellyfin.org/posts/1603/backup-and-restore

I'm sure this feature is being actively developed still, so I want to add my 2¢ to the discussion.

What I'd like to see in the backup/restore feature is the following:
  • A simple GUI for creating and restoring backups.
  • A "restore" button in the Web UI setup wizard that comes up on first launch. That way we won't have to configure the server just to restore it right after.
  • Backups should be platform agnostic, so they can be restored from any system.
  • Library database items shouldn't be linked to a full file path since this can change in a migration. Give the user an option to define the new library paths on restore, and use a variable for the file paths based on that in the database.
  • MariaDB option.
  • Backup as a scheduled task so it can run regularly.

It's definitely no small task to get all of this worked out, but it will definitely give users more peace of mind that their server is safe. Feel free to further contribute to the discussion of the feature in this thread!


RE: Jellyfin Backups & Migration - Fabri91 - 2023-09-22

I agree that this feature would be very useful - at a bare minimum an easier way to backup and restore an "already watched" list would make migrating significantly easier.


RE: Jellyfin Backups & Migration - TheDreadPirate - 2023-09-22

You can achieve, effectively, the same thing by backing up the jellyfin and library database files.


RE: Jellyfin Backups & Migration - LeviSnoot - 2023-10-22

TheDreadPirate dateline='[url=tel:1695386170' Wrote: 1695386170[/url]']
You can achieve, effectively, the same thing by backing up the jellyfin and library database files.

I believe this only works if the base file paths for library items is identical on restore, which may not always be the case.


RE: Jellyfin Backups & Migration - Marco2G - 2023-12-26

I have to agree with the others, the way proposed by TheDreadPirate isn't satisfactory... I have tried this at one point and failed utterly. I was trying to move from an apt installed Jellyfin to docker and I could not get this to work, despite users on reddit helping me out and me trying to correct paths in the files manually.

There absolutely needs to be a way to move the database in an installation type agnostic way.


RE: Jellyfin Backups & Migration - cesar_bianchi - 2024-08-09

Hy Guys

To help some users who are looking for a automatic jellyfin backup solution, I written a post with a suggest solution

It was written for Linux instances, but it's so simple change for another platforms kind.

https://forum.jellyfin.org/t-automatic-run-backup-of-your-jellyfin-instance


RE: Jellyfin Backups & Migration - tim0502 - 2025-03-06

Hi guys,

I've created a script that does a backup to a cloud location using rclone.
with crontab you can automate it. I used it on Ubuntu Server.
I run the script as root to need have any rights issues.

#!/bin/bash

# Variables
BACKUP_DIRS=("/var/lib/jellyfin" "/etc/jellyfin")  # Directories to back up
DEST_DIR="/mnt/data/backup-temp"  # Local temp storage for ZIPs
ONEDRIVE_FOLDER="Backup/Jellyfin"  # Folder name in OneDrive
MAX_BACKUPS=3  # Maximum number of backups to keep
JELLYFIN_SERVICE="jellyfin"  # Jellyfin service name

# Timestamp format YYYYMMDD_HHMMSS
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
ZIP_FILE="$DEST_DIR/Jellyfin_backup_$TIMESTAMP.zip"

# Ensure destination directory exists
mkdir -p "$DEST_DIR"

# Stop Jellyfin before backup
echo "Stopping Jellyfin service..."
sudo systemctl stop "$JELLYFIN_SERVICE"

# Create a ZIP archive
echo "Creating backup archive..."
if zip -r "$ZIP_FILE" "${BACKUP_DIRS[@]}"; then
    echo "Backup created successfully: $ZIP_FILE"
else
    echo "Backup creation failed!"
    sudo systemctl start "$JELLYFIN_SERVICE"
    exit 1
fi

# Start Jellyfin after backup
echo "Starting Jellyfin service..."
sudo systemctl start "$JELLYFIN_SERVICE"

# Upload to OneDrive using rclone
export RCLONE_CONFIG=/home/tim/.config/rclone/rclone.conf
echo "Uploading backup to OneDrive..."
if rclone copy "$ZIP_FILE" onedrive:"$ONEDRIVE_FOLDER" --progress; then
    echo "Upload successful."
    rm "$ZIP_FILE"  # Remove local ZIP after upload
else
    echo "Upload failed!"
    exit 1
fi

# Delete oldest backups if more than $MAX_BACKUPS exist
echo "Checking for old backups to delete..."
BACKUPS_ON_ONEDRIVE=$(rclone lsf onedrive:"$ONEDRIVE_FOLDER" | sort | head -n -$MAX_BACKUPS)

for FILE in $BACKUPS_ON_ONEDRIVE; do
    echo "Deleting old backup: $FILE"
    rclone delete onedrive:"$ONEDRIVE_FOLDER/$FILE"
done


RE: Jellyfin Backups & Migration - enesha - 2025-03-08

(2023-09-22, 12:36 PM)TheDreadPirate Wrote: You can achieve, effectively, the same thing by backing up the jellyfin and library database files.

Effectively, yes you can apparently do that.  This does not allow EASY backup and restore, nor does it provide flexibility. (see my note in another forum wanting to import the viewed state of my library) .  It requires more than standard user ability.  The ability to export and import (perhaps choosing which tables to import...Maybe users, but not access or whatever...Up to the admin.

I am sure I don't know the work involved with such a thing.  The programming here is next to magic in my opinion, so I can't say it would be easy, but it's better than the admins and users needing to know the ins and out of the installs on the various platforms...where is the windows data, where is the docker data, where is it in *nix....

You can make certain assumptions (not really correct necess. these days) regarding capability of users/admins in win/mac/*nix/docker based on where they are from, but that's the pointy of asking for a unified experience Smiling-face