Jump to content

Migrate library location and maintain watched status


westhill

Recommended Posts

westhill

I am running Emby as a Synology package on my 920+ and have a [local] library and an identical library [remote] copy of that directory on a share the Syno can see.

The primary library has been the [remote] one not hosted on the NAS and now I want to point the Emby library at the local NAS copy instead while maintaining the watched status.

 

I have been playing with a small library [remote and local] and while I can change the file locations it loses the watched status.

Any suggestions would be greatly appreciated, thanks.

 

Link to comment
Share on other sites

Happy2Play

Watched statuses are maintained by providerid (IMDB, TMDB, TVDB and others).  Only items that do not have providerid will loose played/watched state, Emby using the databaseid for these items and that id is nuked when items are moved as Emby removes and readds the item.

If that is the case then your only option is manually updating the database with the new path for the items.  And possibly other columns like parentid.

But specific examples would provide more information.  But don't really follow this Local and Remote library logic as if this is one server then there is only one watched status no matter the library.

Edited by Happy2Play
  • Thanks 1
Link to comment
Share on other sites

westhill

Yes, only one Emby server. What I mean by local and remote is Emby is installed on the NAS [local] and I have a library #1 that points to a local directory on that NAS. I have a second library #2 on a remote Windows box that has a second library associated with it.

Library #1 and #2 have identical content, we have been watching the content from library #2 and now I am ready to cutover to library #1.

The directory/file I was testing with does not have tvdb metadata, I will try testing with one that does - thanks for pointing me in that direction.

Link to comment
Share on other sites

westhill

I was playing around and think I got it sorted out. I dropped a moves with metadata into the directory, set it to 50% watched and then moved it to the other library and it maintained the watched status.

Thanks again for nudging me in the right direction.

Link to comment
Share on other sites

Is this only a movie library or different library types?
Can you give us a bit more info on the setup/content wise?

Link to comment
Share on other sites

westhill
56 minutes ago, cayars said:

Is this only a movie library or different library types?
Can you give us a bit more info on the setup/content wise?

I have primarily three libraries:

TV, Movies and Mixed_Bag (both TV/Movies)

I am primarily interested in preserving the TV watched status. I suppose I could quickly test this by deleting the current path on the old_location and pointing it at the new_location and if things are wonky point it back at the old location while I sort it out, no?

Link to comment
Share on other sites

I wouldn't change things in large scale to start out with, even for a test.

Matter of fact, I personally would shut down Emby server, go to the data folder and copy the library.db file.  This way I can put it back if needed.

So what I would do is create a new TV Show library and mount this to the new location you already setup to hold this.
I would pick then pick a small TV Show you presently have and make sure it has some watched status for you.  If not, mark a few episodes played so you do have some watched status.
Remove them from the old location and do a full library scan.  At this point this one show will be removed.

Now move it to the new location you setup for the new test library and do a full library scan.
How does the watched status look?

If things went well you can now try moving a couple more shows, do a full library scan and check again. Once you feel comfortable it's working correctly you should be able to mass move things.

If anything goes wrong, put the files back to the original location, shut down Emby Server, remove the current library.db and rename the copied very back to library.db.
Then restart Emby Server.

Let us know how you make out.

  • Thanks 1
Link to comment
Share on other sites

westhill
1 hour ago, cayars said:

I wouldn't change things in large scale to start out with, even for a test.

Matter of fact, I personally would shut down Emby server, go to the data folder and copy the library.db file.  This way I can put it back if needed.

This is a good plan, thanks for the suggestion. I have been backing up Emby on my Syno with HyperBackup on a daily basis but have never shutdown Emby prior, it makes sense to get a good copy of the database while the app is stopped - I just did this now for safe keeping.

I noticed Emby does a daily backup under backup-configs but I don't see library.db inside of it.

Link to comment
Share on other sites

That doesn't back up your databases but all the configs, hence the name.
It does backup some key info from the databases such as your users and their watched status.

It's designed so you can do a fresh install, restore all the settings and then rescan which will reload your libs and recreate all the meta-data.

If you have the ability such as your self with a good backup app, once it a while shut down Emby and backup the data and config folders which should be very quick.  All the other folders such as cache and meta-data are fine to backup while running.

  • Thanks 1
Link to comment
Share on other sites

westhill

Are you able to import those backups cross-platform? Say I want to port my config from native Synology to docker or Windows.

Thanks again for the top about shutting down Menu to get a clean backup. 

Link to comment
Share on other sites

Happy2Play
6 minutes ago, westhill said:

Are you able to import those backups cross-platform? Say I want to port my config from native Synology to docker or Windows.

Thanks again for the top about shutting down Menu to get a clean backup. 

Yes and No.  No for anything that is Path (library paths or customized paths for default folders) dependent as they are platform relevant.  But overall most configs are platform irrelevant.

  • Like 1
Link to comment
Share on other sites

As @Happy2Play says, the config can be restored without problem.  This will restore your library setup AS IT WAS previously which may not be the correct paths now.
So in a case like that you would need to change the mount points for each library but all the library settings otherwise should be the same.

Once you've corrected any path issues that differ you should be able to do a full library scan and get things loaded back the way it was previously.

  • Like 1
Link to comment
Share on other sites

  • 2 years later...
kakashi55
On 11/12/2021 at 4:19 AM, Happy2Play said:

Watched statuses are maintained by providerid (IMDB, TMDB, TVDB and others). 

So even if I change my operating system from Windows to Linux and also change paths of media, even then Watched status will be maintained ??

Link to comment
Share on other sites

2 minutes ago, kakashi55 said:

So even if I change my operating system from Windows to Linux and also change paths of media, even then Watched status will be maintained ??

Hi, generally, yes.

Link to comment
Share on other sites

kakashi55
10 minutes ago, Luke said:

Hi, generally, yes.

But favourites won't be preserved in same case because they don't depend on provider id, rather they depend on database id. 

Am I correct ??

Edited by kakashi55
Link to comment
Share on other sites

10 minutes ago, kakashi55 said:

But favourites won't be preserved in same case because they don't depend on provider id, rather they depend on database id. 

Am I correct ??

They will. They are stored the same way as watch data.

Link to comment
Share on other sites

Happy2Play

In theory the plugin is supposed to cover all userdata but am not currently sure as one will/should not do a restore across platforms for library and library.db do to path changes.

@LukeHow does one extract userdata from one server platform to another platform as the new plugin is dependent on the entire backup packed info.

So in this situation one still needs the Legacy Backup plugin and users.db?

Link to comment
Share on other sites

I wouldn’t suggest doing a full restore to a different platform just yet. We still need to look at some things in the backup plugin before we can say that’s supported.

 But the plugin does have a function to just extract user data and yes that can be used across different platforms.

Link to comment
Share on other sites

Happy2Play

Was just rethinking this and yes one would do a backup on Windows server and copy that backup or point new platform server to the backup location and only perform the Extract Data from backup.

But at the same time one would want to use the backed up users.db to prevent having to reapply all users.  There is another issue as one will want the Users folder also.

This requires Backup Plugin Version1.6.2.0 or newer.

So a cross platform restore will require manual frankensteining in some ways as the plugin will primarily do backups for alike platforms.

Link to comment
Share on other sites

kakashi55
14 minutes ago, Luke said:

I wouldn’t suggest doing a full restore to a different platform just yet

I use nfo files to store metadata. So, I just want to restore Watched status, Favourites and Collections. 

From above discussion, it is clear that Watched status can be restored but please give me clarity on favourites when we change operating system from Windows to Linux. There is only 1 user in emby server.

Thanks.

Edited by kakashi55
Link to comment
Share on other sites

Happy2Play

@LukeCan the Extract Data wording be updated.

New

image.png.dc064e91e9efb9385b1ba59fb66a72bf.png

Legacy

image.png.0bd371de02b0a62ee880c866b5d8fe3c.png

  • Thanks 2
Link to comment
Share on other sites

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