• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Migration: Linux to Docker

     
    • 0 Vote(s) - 0 Average

    Migration: Linux to Docker

    Migrating a Linux install to a Docker install
    designingbeing
    Offline

    Junior Member

    Posts: 15
    Threads: 7
    Joined: 2024 Aug
    Reputation: 0
    #1
    2025-02-20, 05:41 AM
    Is there a guide to migrating Linux to Docker on a different machine?

    I'm getting an error: System.InvalidOperationException: There is an error in XML document (400, 26).

    What I've done so far is:
    • Backup /etc/jellyfin using cp -a
    • Backup /var/lib/jellyfin using cp -a
    • Copy the backups to the new machine in their own subfolders
    • Modify docker-compose.yaml (see below for file contents)
    • Run docker compose up 


    docker-compose.yaml

    Code:
    services:
      jellyfin:
        image: jellyfin/jellyfin
        container_name: jellyfin
        user: 1000:1000
        network_mode: 'host'
        environment:
          - JELLYFIN_CONFIG_DIR=/etc/jellyfin
          - JELLYFIN_DATA_DIR=/var/lib/jellyfin
          - JELLYFIN_LOG_DIR=/var/log/jellyfin
        volumes:
          - /home/myusername/config/jellyfin/data:/var/lib/jellyfin
          - /home/myusername/config/jellyfin/config:/etc/jellyfin
          - /mystoragepath/logs/jellyfin:/var/log/jellyfin
          - /mystoragepath/cache/jellyfin:/cache
          - /mystoragepath/jellyfin/movies:/mnt/sdb2/common/jellyfin/movies
          - /mystoragepath/jellyfin/shows:/mnt/sdb2/common/jellyfin/shows
          - /mystoragepath/jellyfin/music:/mnt/sdb2/common/jellyfin/music
        restart: 'unless-stopped'
        # Optional - alternative address used for autodiscovery
        #environment:
        #  - JELLYFIN_PublishedServerUrl=http://example.com
        # Optional - may be necessary for docker healthcheck to pass if running in host network mode
        extra_hosts:
          - 'host.docker.internal:host-gateway'



    Full docker error output

    Code:
    $ docker compose up
    [+] Running 1/1
    ✔ Container jellyfin  Recreated                                                                                                                                    0.1s
    Attaching to jellyfin
    jellyfin  | [05:32:05] [INF] Jellyfin version: 10.10.5
    jellyfin  | [05:32:05] [INF] Environment Variables: ["[JELLYFIN_DATA_DIR, /var/lib/jellyfin]", "[JELLYFIN_CACHE_DIR, /cache]", "[JELLYFIN_FFMPEG, /usr/lib/jellyfin-ffmpeg/ffmpeg]", "[JELLYFIN_LOG_DIR, /var/log/jellyfin]", "[JELLYFIN_WEB_DIR, /jellyfin/jellyfin-web]", "[JELLYFIN_CONFIG_DIR, /etc/jellyfin]"]
    jellyfin  | [05:32:05] [INF] Arguments: ["/jellyfin/jellyfin.dll"]
    jellyfin  | [05:32:05] [INF] Operating system: Debian GNU/Linux 12 (bookworm)
    jellyfin  | [05:32:05] [INF] Architecture: X64
    jellyfin  | [05:32:05] [INF] 64-Bit Process: True
    jellyfin  | [05:32:05] [INF] User Interactive: True
    jellyfin  | [05:32:05] [INF] Processor count: 1
    jellyfin  | [05:32:05] [INF] Program data path: /var/lib/jellyfin
    jellyfin  | [05:32:05] [INF] Log directory path: /var/log/jellyfin
    jellyfin  | [05:32:05] [INF] Config directory path: /etc/jellyfin
    jellyfin  | [05:32:05] [INF] Cache path: /cache
    jellyfin  | [05:32:05] [INF] Temp directory path: /tmp/jellyfin
    jellyfin  | [05:32:05] [INF] Web resources path: /jellyfin/jellyfin-web
    jellyfin  | [05:32:05] [INF] Application directory: /jellyfin/
    jellyfin  | [05:32:05] [FTL] Unhandled Exception
    jellyfin  | System.InvalidOperationException: There is an error in XML document (400, 26).
    jellyfin  |  ---> System.Xml.XmlException: Unexpected end of file while parsing Name has occurred. Line 400, position 26.
    jellyfin  |    at System.Xml.XmlTextReaderImpl.Throw(Exception e)
    jellyfin  |    at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
    jellyfin  |    at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)
    jellyfin  |    at System.Xml.XmlTextReaderImpl.ParseElement()
    jellyfin  |    at System.Xml.XmlTextReaderImpl.ParseElementContent()
    jellyfin  |    at System.Xml.XmlReader.MoveToContent()
    jellyfin  |    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMigrationOptions.Read3_MigrationOptions(Boolean isNullable, Boolean checkType)
    jellyfin  |    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMigrationOptions.Read4_MigrationOptions()
    jellyfin  |    at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
    jellyfin  |    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
    jellyfin  |    --- End of inner exception stack trace ---
    jellyfin  |    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
    jellyfin  |    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
    jellyfin  |    at Emby.Server.Implementations.Serialization.MyXmlSerializer.DeserializeFromStream(Type type, Stream stream)
    jellyfin  |    at Emby.Server.Implementations.Serialization.MyXmlSerializer.DeserializeFromFile(Type type, String file)
    jellyfin  |    at Jellyfin.Server.Migrations.MigrationRunner.RunPreStartup(ServerApplicationPaths appPaths, ILoggerFactory loggerFactory)
    jellyfin  |    at Jellyfin.Server.Program.StartApp(StartupOptions options)
    jellyfin  |    at Jellyfin.Server.Program.<Main>(String[] args)
    jellyfin  | Unhandled exception. System.InvalidOperationException: There is an error in XML document (400, 26).
    jellyfin  |  ---> System.Xml.XmlException: Unexpected end of file while parsing Name has occurred. Line 400, position 26.
    jellyfin  |    at System.Xml.XmlTextReaderImpl.Throw(Exception e)
    jellyfin  |    at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
    jellyfin  |    at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)
    jellyfin  |    at System.Xml.XmlTextReaderImpl.ParseElement()
    jellyfin  |    at System.Xml.XmlTextReaderImpl.ParseElementContent()
    jellyfin  |    at System.Xml.XmlReader.MoveToContent()
    jellyfin  |    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMigrationOptions.Read3_MigrationOptions(Boolean isNullable, Boolean checkType)
    jellyfin  |    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMigrationOptions.Read4_MigrationOptions()
    jellyfin  |    at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
    jellyfin  |    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
    jellyfin  |    --- End of inner exception stack trace ---
    jellyfin  |    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
    jellyfin  |    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
    jellyfin  |    at Emby.Server.Implementations.Serialization.MyXmlSerializer.DeserializeFromStream(Type type, Stream stream)
    jellyfin  |    at Emby.Server.Implementations.Serialization.MyXmlSerializer.DeserializeFromFile(Type type, String file)
    jellyfin  |    at Jellyfin.Server.Migrations.MigrationRunner.RunPreStartup(ServerApplicationPaths appPaths, ILoggerFactory loggerFactory)
    jellyfin  |    at Jellyfin.Server.Program.StartApp(StartupOptions options)
    jellyfin  |    at Jellyfin.Server.Program.<Main>(String[] args)
    jellyfin exited with code 139
    jellyfin  | [05:32:06] [INF] Jellyfin version: 10.10.5
    jellyfin  | [05:32:06] [INF] Environment Variables: ["[JELLYFIN_WEB_DIR, /jellyfin/jellyfin-web]", "[JELLYFIN_FFMPEG, /usr/lib/jellyfin-ffmpeg/ffmpeg]", "[JELLYFIN_CONFIG_DIR, /etc/jellyfin]", "[JELLYFIN_LOG_DIR, /var/log/jellyfin]", "[JELLYFIN_CACHE_DIR, /cache]", "[JELLYFIN_DATA_DIR, /var/lib/jellyfin]"]
    jellyfin  | [05:32:06] [INF] Arguments: ["/jellyfin/jellyfin.dll"]
    jellyfin  | [05:32:06] [INF] Operating system: Debian GNU/Linux 12 (bookworm)
    jellyfin  | [05:32:06] [INF] Architecture: X64
    jellyfin  | [05:32:06] [INF] 64-Bit Process: True
    jellyfin  | [05:32:06] [INF] User Interactive: True
    jellyfin  | [05:32:06] [INF] Processor count: 1
    jellyfin  | [05:32:06] [INF] Program data path: /var/lib/jellyfin
    jellyfin  | [05:32:06] [INF] Log directory path: /var/log/jellyfin
    jellyfin  | [05:32:06] [INF] Config directory path: /etc/jellyfin
    jellyfin  | [05:32:06] [INF] Cache path: /cache
    jellyfin  | [05:32:06] [INF] Temp directory path: /tmp/jellyfin
    jellyfin  | [05:32:06] [INF] Web resources path: /jellyfin/jellyfin-web
    jellyfin  | [05:32:06] [INF] Application directory: /jellyfin/
    jellyfin  | [05:32:06] [FTL] Unhandled Exception
    jellyfin  | System.InvalidOperationException: There is an error in XML document (400, 26).
    jellyfin  |  ---> System.Xml.XmlException: Unexpected end of file while parsing Name has occurred. Line 400, position 26.
    jellyfin  |    at System.Xml.XmlTextReaderImpl.Throw(Exception e)
    jellyfin  |    at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
    jellyfin  |    at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)
    jellyfin  |    at System.Xml.XmlTextReaderImpl.ParseElement()
    jellyfin  |    at System.Xml.XmlTextReaderImpl.ParseElementContent()
    jellyfin  |    at System.Xml.XmlReader.MoveToContent()
    jellyfin  |    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMigrationOptions.Read3_MigrationOptions(Boolean isNullable, Boolean checkType)
    jellyfin  |    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMigrationOptions.Read4_MigrationOptions()
    jellyfin  |    at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
    jellyfin  |    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
    jellyfin  |    --- End of inner exception stack trace ---
    jellyfin  |    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
    jellyfin  |    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
    jellyfin  |    at Emby.Server.Implementations.Serialization.MyXmlSerializer.DeserializeFromStream(Type type, Stream stream)
    jellyfin  |    at Emby.Server.Implementations.Serialization.MyXmlSerializer.DeserializeFromFile(Type type, String file)
    jellyfin  |    at Jellyfin.Server.Migrations.MigrationRunner.RunPreStartup(ServerApplicationPaths appPaths, ILoggerFactory loggerFactory)
    jellyfin  |    at Jellyfin.Server.Program.StartApp(StartupOptions options)
    jellyfin  |    at Jellyfin.Server.Program.<Main>(String[] args)
    jellyfin  | Unhandled exception. System.InvalidOperationException: There is an error in XML document (400, 26).
    jellyfin  |  ---> System.Xml.XmlException: Unexpected end of file while parsing Name has occurred. Line 400, position 26.
    jellyfin  |    at System.Xml.XmlTextReaderImpl.Throw(Exception e)
    jellyfin  |    at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
    jellyfin  |    at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)
    jellyfin  |    at System.Xml.XmlTextReaderImpl.ParseElement()
    jellyfin  |    at System.Xml.XmlTextReaderImpl.ParseElementContent()
    jellyfin  |    at System.Xml.XmlReader.MoveToContent()
    jellyfin  |    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMigrationOptions.Read3_MigrationOptions(Boolean isNullable, Boolean checkType)
    jellyfin  |    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMigrationOptions.Read4_MigrationOptions()
    jellyfin  |    at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
    jellyfin  |    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
    jellyfin  |    --- End of inner exception stack trace ---
    jellyfin  |    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
    jellyfin  |    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
    jellyfin  |    at Emby.Server.Implementations.Serialization.MyXmlSerializer.DeserializeFromStream(Type type, Stream stream)
    jellyfin  |    at Emby.Server.Implementations.Serialization.MyXmlSerializer.DeserializeFromFile(Type type, String file)
    jellyfin  |    at Jellyfin.Server.Migrations.MigrationRunner.RunPreStartup(ServerApplicationPaths appPaths, ILoggerFactory loggerFactory)
    jellyfin  |    at Jellyfin.Server.Program.StartApp(StartupOptions options)
    jellyfin  |    at Jellyfin.Server.Program.<Main>(String[] args)
    designingbeing
    Offline

    Junior Member

    Posts: 15
    Threads: 7
    Joined: 2024 Aug
    Reputation: 0
    #2
    2025-02-20, 07:57 AM
    Looks like a problem just began on the system I'm migrating from... any ideas how to resolve this?

    I'm not even sure which xml file is causing the error.


    .zip   jellyfinerror.zip (Size: 100.81 KB / Downloads: 44)

    Logs attached above.
    Harmless
    Offline

    Junior Member

    Posts: 2
    Threads: 0
    Joined: 2025 Feb
    Reputation: 0
    #3
    2025-02-20, 03:19 PM
    Yeah, I would also like some help. I recently upgraded my server along with the system (Ubuntu -> Unraid), but just copying the files and changing the file paths does not help. I'm able to log in, but other than that, viewing media is broken.

    My current thought process is to just copy the users and their metadata over to the new system and rebuild the library.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #4
    2025-02-20, 03:22 PM (This post was last modified: 2025-02-20, 03:25 PM by TheDreadPirate.)
    You can delete any/all of the XMLs in /etc/jellyfin. They will regenerate with defaults. Try deleting them and restart the service.

    (2025-02-20, 03:19 PM)Harmless Wrote: Yeah, I would also like some help. I recently upgraded my server along with the system (Ubuntu -> Unraid), but just copying the files and changing the file paths does not help. I'm able to log in, but other than that, viewing media is broken.

    My current thought process is to just copy the users and their metadata over to the new system and rebuild the library.

    This is a bit more complicated of a situation than the original process is written for.  The original migration process assumes you are still on plain Linux.  But if you are also migrating to unRAID, you'd need to add some additional volumes for each migrated folder and map them to the directories the migration guide specifies.  IN ADDITION to altering the environment variables for each jellyfin directory variable.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Harmless
    Offline

    Junior Member

    Posts: 2
    Threads: 0
    Joined: 2025 Feb
    Reputation: 0
    #5
    2025-02-21, 08:28 AM
    (2025-02-20, 03:22 PM)TheDreadPirate Wrote: This is a bit more complicated of a situation than the original process is written for.  The original migration process assumes you are still on plain Linux.  But if you are also migrating to unRAID, you'd need to add some additional volumes for each migrated folder and map them to the directories the migration guide specifies.  IN ADDITION to altering the environment variables for each jellyfin directory variable.

    By "add some additional volumes for each migrated folder" do you mean the media/cache folder(s), as this is automatically done by the unRAID docker container and I've already set that up. Just for more context, when I try to scan the library it gives me errors in the log where it is still trying to find and use the old /var/lib.... file paths. If I could find a way to manually update these I might be able to get it to work.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #6
    2025-02-21, 03:42 PM
    You cannot import your bare metal linux install into a docker install without significant configuration changes. Jellyfin uses a lot of absolute paths for metadata files and images. The migration document specifics how you modify docker to trick it into using the existing data from the bare metal install.

    But those paths don't exist in your unRAID setup. The migration document assumes you are not migrating to a different OS or different machine entirely. It assumes you are staying on the same host and same OS, but switching to running Jellyfin in Docker vs a system service.

    You'd have to do ADDITIONAL configuration in unRAID to create those paths and then map additional paths in unRAID to match how Jellyfin's data would arranged in a bare metal install.


    /host/volume/jellyfin/etcConfused-faceetc/jellyfin
    /host/volume/jellyfin/varlibConfused-facevar/lib/jellyfin
    /host/volume/jellyfin/varcacheConfused-facevar/cache/jellyfin
    /host/volume/jellyfin/varlogConfused-facevar/log/jellyfin

    Something like that. Then you modify the docker environment variables for the data directory, cache directory, etc., to use those directories instead of the docker defaults in "/config" and "/cache".
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode