Migration: Linux to Docker - designingbeing - 2025-02-20
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)
RE: Migration: Linux to Docker - designingbeing - 2025-02-20
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.
jellyfinerror.zip (Size: 100.81 KB / Downloads: 5)
Logs attached above.
RE: Migration: Linux to Docker - Harmless - 2025-02-20
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.
RE: Migration: Linux to Docker - TheDreadPirate - 2025-02-20
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.
RE: Migration: Linux to Docker - Harmless - 2025-02-21
(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.
RE: Migration: Linux to Docker - TheDreadPirate - 2025-02-21
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/etc etc/jellyfin
/host/volume/jellyfin/varlib var/lib/jellyfin
/host/volume/jellyfin/varcache var/cache/jellyfin
/host/volume/jellyfin/varlog var/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".
|