How to migrate from Plex to Jellyfin

A quick how-to describing how to migrate your library and it's history from Plex to Jellyfin.

How to migrate from Plex to Jellyfin

I've been running Plex for well over a decade at this point and have on the surface been relatively happy with it. However, over the last few years, it's been gradually getting worse. There's been a clear shift away from Plex being a media server that manages your own library, to an app that focuses on serving you content from third party streaming services. So it's time to move on and find an alternative.

Jellyfin - an open source Plex alternative

Looking at a few options such as Emby and Kodi, I ended up deciding to go with Jellyfin.

Jellyfin will seem very familiar to Plex users migrating over. The setup is pretty straightforward and will remind you of setting up your libraries on Plex. However, the big advantage of Jellyfin is that it's open-source, meaning you have full control over your setup. Plus, Jellyfin boasts a vibrant community that constantly updates and improves the platform. With features like live TV integration, advanced metadata management, and a growing ecosystem of plugins, Jellyfin is a versatile choice for those seeking a customizable and future-proof media center solution.

Once you've completed your setup of your libraries, and manually fixed any unmatched shows or movies, the migration of your watch history can begin.

Migrating your watch history

For this, there are a few options. If you've used Trakt.tv, you can simply use the plugin and it'll update your library accordingly. However, as Plex has effectively deprecated plugins, Trakt.tv was not really an option anymore.

This is where I found a great little script and docker container to migrate your view history called JellyPlex-Watched. One other perk is that it can do this for multiple users.

I'm assuming here you have a running docker environment and are running both Plex and Jellyfin on the same machine.

First, we'll set up the environment file. Just copy the file from the repository to your local machine and rename it:

$ wget https://raw.githubusercontent.com/luigi311/JellyPlex-Watched/main/.env.sample
$ mv .env.sample jellyplex.env

Now go and edit the file with your editor of choice.

Some of the key variables I'd recommend editing:

  • DRYRUN: set this one to true until you've at least run it through once. Change it to false once you're sure the changes it will make are correct.
  • RUN_ONLY_ONCE: Set this to True, to just run it once.
  • GENERATE_GUIDS / GENERATE_LOCATIONS: If you're running Jellyfin and Plex on the same machine, you can probably disable GENERATE_GUIDS and only use GENERATE_LOCATIONS.
  • USER_MAPPING: If you have different usernames on Plex and Jellyfin, you can add the mapping here.
  • LIBRARY_MAPPING: Similar to the previous one, if you have different library names, you can map them here.
  • WHITELIST_USERS: Add all the users who's history you'd like to sync here.
  • PLEX_BASEURL: The local address of your Plex server.
  • PLEX_TOKEN: You'll need to extract the Plex token, For this, follow this guide.
  • JELLYFIN_BASEURL: The local address of your Jellyfin server
  • JELLYFIN_TOKEN: In your Jellyfin Admin Dashboard, simply go to API Keys and create an API key for JellyPlex. Then use that key in this variable.
  • SYNC_FROM_PLEX_TO_JELLYFIN: Lastly, check the syncing options. You'll most likely want this one to be true, and all others false.

Now that you have the configuration file ready, simply run the docker container.

$ docker run --rm -it -v "$(pwd)/jellyplex.env:/app/.env" luigi311/jellyplex-watched:latest

Now you should see it log in to both Jellyfin and Plex and get your view history on both. Once you're happy with the suggested changes it wants to make to your library, update the jellyplex.env file changing DRYRUN from True to False, at which point it'll start marking the movies in your library as watched.

Ongoing syncing & summary

Now, you can run this container and have it sync on a daily basis if you'd like. However, as you'll most likely migrate to Jellyfin anyway, no need to sync changes back and forth.

That's all - your Jellyfin library will have the same history as your Plex one.