Jump to content

Emby 4.8 to 4.9 upgrade - needed to set "legacy" folder scanning mode


Recommended Posts

ganglepin
Posted (edited)

I have been running Emby 4.8.10.0 since September 2024 and first attempted to upgrade to 4.9.1.80 in September 2025. This caused full metadata loss, so reinstalled 4.8 and restored from a backup. Due to that incident I also set up daily Btrfs snapper snapshots in addition to the Backup & Restore plugin since my backup was quite old.

This week, I attempted to upgrade to 4.9.5.0 again, and ran into the same issue. The timeline was as follows:

  1. The 4.9 upgrade installs without any errors
  2. Navigating the library in the Emby UI works fine
  3. Playing media works fine
  4. Go to Movies -> Scan Library Files
  5. All metadata disappears and everything starts being reimported from scratch

Even with debug logging enabled, there is nothing obvious other than entries showing that each movie gets deleted and removed one by one.

Comparing the database tables, one difference I could see is that the MediaItems table had double entries in the 4.9 database - one for the folder the movie is in, and one for the movie file itself. In the 4.8 database, there is just one entry for the movie file. Both of the 4.9 entries for each movie were newly added from the post-upgrade scan. My media library uses the structure "/base/path/Movie Name (Year)/Movie Name (Year).ext"

I checked the content type, and my movie library is set to the Movies type.

For this particular server, I am not using the save .nfo option, instead relying on the database and Emby library directory.

The "Folder scanning mode" for movies was set to "Default" after the upgrade. I discovered that changing it to "Legacy" before doing the "Scan Library Files" step, fixed the issue - no metadata loss when scanning. I note that when it is set to Legacy, the entries in MediaItems match the 4.8 behaviour (i.e. no double-entry for the parent directory).

What does the Legacy option actually mean, and will it be removed at some point in the future? This seems like a bug. Can Emby detect the situation where Legacy mode is needed; for example, by looking at the existing entries in the MediaItems table?

I'm not sure why this is necessary because this particular deployment is my newest Emby server, and was originally set up using a 4.6.x version. It's not ancient. My other server is much older but uses nfo files and wasn't affected.

Edited by ganglepin
clarifying movie directory structure
Posted

Hello ganglepin,

** This is an auto reply **

Please wait for someone from staff support or our members to reply to you.

It's recommended to provide more info, as it explain in this thread:


Thank you.

Emby Team

Posted

Hi, the reason for the folder layer is to help make the folder view more accurate. Yes you might be right that we could have auto detected if it was needed, but at this point the vast majority of 4.8 to 4.9 updates have been done so we probably won’t revisit it. Apologies for the disruption.

ganglepin
Posted (edited)

Thanks for the reply, but won't all of us who are affected by this bug end up in the same situation when the "Legacy" scanning option eventually gets removed? Or are there no plans to remove it?

This isn't a one-time breakage upon upgrade or schema migration. It will break all existing entries whenever the library is scanned, if "Default" scanning mode is set.

Edited by ganglepin

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...