Jump to content

Migrate library location and maintain watched status


westhill
 Share

Recommended Posts

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

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

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

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

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

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

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

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

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
 Share

×
×
  • Create New...