Jump to content

Recommended Posts

ardinesh
Posted

Emby Server Version: 4.8.11.0
Platform: Ubuntu 24.04
Backup Source: Windows Emby Server (restored using official Backup & Restore plugin)


Issue Summary:
After restoring my Emby library from a Windows-based setup to Ubuntu using the Backup & Restore plugin, I encountered a critical bug related to playlists:

  • Some playlists (created while using Emby on Windows) appear broken in the Emby web UI after the restore.

  • These playlists do not show any contents.

  • When I try to delete such a playlist through the Emby web interface, the confirmation popup shows the location as /var/lib/emby.

  • Upon confirming, Emby deletes the entire Emby directory, leading to total data loss.

  • When the server restarts, it loads the new setup screen, as if it were a fresh install.


Cause / Observation:
Upon inspecting the playlists using the Metadata Editor, I noticed that the path of these broken playlists appears as:

/var/lib/emby/data\userplaylists\Narayan Gopal [playlist]\Narayan Gopal.m3u

This shows a mix of Linux (/) and Windows-style (\) path separators, which may be the root cause.

It seems that the restored playlists from Windows contain malformed paths, and when Emby on Linux tries to delete them, it misinterprets the path and targets the parent Emby data directory instead.


What Works Normally:

  • Playlists created directly on the Linux server can be deleted safely and do not trigger this issue.


Expected Behavior:
Deleting a playlist should only remove the selected playlist's metadata or file.


Actual Behavior:
Deleting a malformed playlist (restored from Windows) deletes the entire /var/lib/emby folder, wiping the server configuration, metadata, users, and media settings.


Steps to Reproduce:

  • Create a playlist using Emby on Windows.

  • Backup the Emby server using the Backup & Restore plugin.

  • Restore the backup on a Linux-based Emby server.

  • Locate and attempt to delete one of the imported playlists using the web interface.

  • Observe the deletion prompt showing /var/lib/emby.

  • Confirm deletion — Emby wipes the entire folder and resets to a fresh install.


Impact:
This is a severe data-loss bug. A user trying to clean up old playlists could accidentally wipe their entire Emby server.


Suggestions:

  • The Backup & Restore plugin should sanitize and convert paths correctly between Windows and Linux.

  • Emby should validate deletion targets to prevent dangerous operations on critical directories.

  • Playlist deletion logic should be made safer by enforcing directory boundaries.


Please let me know if logs or playlist metadata are required. I can reproduce this issue consistently and would be happy to help provide more details.

sa2000
Posted

Thank you for reporting this.

There has been improvements to the handling of malformed playlists on the 4.9.x beta releases where a playlist with invalid media paths would have its contents overwritten. This was fixed in the beta and on initial import failure, the playlist file would remain as is.

I will see if what you describe arises in the beta

sa2000
Posted

Just looking more closely - this is different from the issue I described

This relates to the path of the actual playlist itself

I will look further into this 

Restoring a server to a different OS / Platform is not recommended

 

 

 

 

  • Agree 1
Neminem
Posted

Jup, trying that is a bad idea or short coming with emby backup / restore don't know 🤷‍♂️

windows uses c:\path\

Linux uses /mount/path/

I have never seen a backup system where this was Not a issue.

Most really on the backup being to the same OS.

What Emby needs is a OS migration 🤷‍♂️ and not use a backup for that 😁

sa2000
Posted
17 hours ago, ardinesh said:

Deleting a malformed playlist (restored from Windows) deletes the entire /var/lib/emby folder, wiping the server configuration,

I have just tried a test restore from windows onto ubuntu emby server and then went through a delete playlist

The playlist path was similar to yours

image.png

When attempting to delete that playlist on linux, there was a dialogue box asking for confirmation. In my test on emby server 4.9.1.4, it showed it was trying to delete 

/var/lib/emby

image.png

and when i said go ahead, it failed with Access Denied

image.png

So there is protection against this and in any case the use of the Backup and Restore plugins stipulates in the documentation here  that all paths must remain the same. The only reference to changing platforms on restore is in the manual backup section and in this you are expected to handle each component yourself and you would need to manually edit the database 

7 hours ago, Neminem said:

What Emby needs is a OS migration 🤷‍♂️ and not use a backup for that 😁

I would agree with this

 

ardinesh
Posted
48 minutes ago, sa2000 said:

I have just tried a test restore from windows onto ubuntu emby server and then went through a delete playlist

The playlist path was similar to yours

image.png

When attempting to delete that playlist on linux, there was a dialogue box asking for confirmation. In my test on emby server 4.9.1.4, it showed it was trying to delete 

/var/lib/emby

image.png

and when i said go ahead, it failed with Access Denied

image.png

So there is protection against this and in any case the use of the Backup and Restore plugins stipulates in the documentation here  that all paths must remain the same. The only reference to changing platforms on restore is in the manual backup section and in this you are expected to handle each component yourself and you would need to manually edit the database 

I would agree with this

 

Ya, it does show access denied error but it actually deletes the directory which you will notice after you restart the server i.e. you will be greeted with fresh welcome/setup screen.

Posted

hi, yes we have a bit of work to do when using the restore function going from windows to linux or vice versa. Thanks.

Posted
8 hours ago, ardinesh said:

it does show access denied error but it actually deletes the directory which you will notice after you restart the server i.e. you will be greeted with fresh welcome/setup screen.

Thanks. I have raised an internal feature request for OS migration functionality.

At this moment the user would get a dialogue box showing what would get deleted and also being a restored server, the users would probably have saved a copy of the backup used and can repeat that process and subsequent steps to recover.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...