Jellyfin Forum
migrate jellyfin - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: migrate jellyfin (/t-migrate-jellyfin)



migrate jellyfin - wimmmy - 2024-10-09

New member.
I've searched the forums using "migrate", "backup", "restore", etc; even browsed thru the entire "Guides and Walkthrus".  
Saw a couple suggestions to only copy /etc/jellyfin and /var/lib/jellyfin and that should do it.  It does not do it'
Been using jellyfin for a few years.
Used to just make changes directly on my server, but now, after messing up a couple times, I am trying to stage on my laptop and then move the media/data to the server.
Problem is, it just doesn't work.
I do this on test machine: 
1. stop/disable jellyfin service on both systems 
2. "sudo tar -cf jel.tar jel.tar /var/lib/jellyfin /var/cache/jellyfin /etc/jellyfin /usr/lib/jellyfin" on test system (also tried without the cache)
2a. also tried this:  "sudo tar -cvf jel.tar /var/lib/jellyfin /var/cache/jellyfin /etc/jellyfin /usr/lib/jellyfin ~/.local/share/jellyfin  jellyfin ~/.config/jellyfin"
3. copy jel.tar to main system
4.  log in to main system, "cd /"; "sudo tar -xf ~/jel.tar"

Then restart jellyfin on main system, and get the screen asking for a server name.  I delete that server and then restart and get the wizard.

Apparently there is some other "magic" file that I am missing.
Perhaps, somewhere jellyfin knows it is on a different system.

I am on Linux Mint 21.3.  Same file structure and userids on both systems.

I have used Jellyman, which puts everything in /opt/jellyfin and also provides a backup mechanism, altho never tried to migrate it to different system.
Maybe will bring it back  and try it out again.

Anyone successfully able to migrate/copy to separate machine.

Thank you for any assist

Jimmy


RE: migrate jellyfin - TheDreadPirate - 2024-10-09

I have migrated or restored 3 times. One hardware failure induced restoration from backup, one migration when upgrading hardware and clean installing 24.04, one restoration when I borked the OS after not installing a custom kernel incorrectly.

My backup and restoration method is similar, but I preferred to do it a less consolidated. Here is a summary, but not exactly, how it worked before I switched to docker.

Code:
sudo systemctl stop jellyfin
cd /some/backup/directory
mkdir etcJellyfin libJellyfin cacheJellyfin
rsync -a -p --progress /etc/jellyfin etcJellyfin/
rsync -a -p --progress /var/lib/jellyfin libJellyfin/
rsync -a -p --progress /var/cache/jellyfin cacheJellyfin/
tar cfz jellyfinBackup.tgz

And to restore, after installing jellyfin via apt.

Code:
sudo systemctl stop jellyfin
cd /some/backup/directory
mv ~/jellyfinBackup.tgz .
tar xfz jellyfinBackup.tgz
cd /etc/
rsync -a -p --progress /some/backup/directory/etcJellyfin .
cd /var/lib
rsync -a -p --progress /some/backup/directory/libJellyfin .
cd /var/cache
rsync -a -p --progress /some/backup/directory/cacheJellyfin .

I know you said that both systems have the same UIDs for Jellyfin, but I always ensure that it wasn't changed at some point in the process.

Code:
sudo chown -R jellyfin: /var/lib/jellyfin /var/cache/jellyfin /etc/jellyfin
sudo systemctl start jellyfin



RE: migrate jellyfin - wimmmy - 2024-10-13

I dunno. Actually, my uid is not the same on both systems, but did a chown on target, Still no da.
I am still getting the wizard.
on target sys: sudo systemctl stop jellyfin
untar the directories that were tarred on source system: /var/lib/jellyfin /var/cache/jellyfin /etc/jellyfin
then: sudo chown -R jellyfin: /var/lib/jellyfin /var/cache/jellyfin /etc/jellyfin
restart and still the wizard

I see a file /var/lib/jellyfin/device.txt = 40eea15a153347aba1075848f0e28c1e
Wonder if this is tying it to a specific system.

Spotted "jellyfin migrator" on git - gonna try that next.


RE: migrate jellyfin - madsepperl - 2024-10-14

I just followed the steps from thedreadpirate (thanks, man!) and it worked perfectly for me to completely move the jellyfin installation from one server to another.

Just a few changes/remarks:

the rsync commands to restore are missing a / at the end of the source directory
I deleted the jellyfin directories on the new server before doing the restore:

Code:
cd /etc/
rm -r jellyfin
rsync -a -p --progress /some/backup/directory/etcJellyfin/ .



RE: migrate jellyfin - wimmmy - 2024-10-20

I give up. Way too much trouble with these files spread all over the filesystem.
Found this: https://github.com/Smiley-McSmiles/jellyman
Made a few modifications to it to totally isolate all of jellyfin to /opt/jellyfin. S
rsync to other system, copy jellyfin.service to it's rightful place.
Voila, migrated and works.

Thanks for all

Jimmy