Jump to content

Restore User Data - Emby Migration - Clarification


ashbinder

Recommended Posts

ashbinder

Hi there,

 

I'm looking to migrate my Emby server to a new computer and have been looking at this link for guidance:

 

https://github.com/MediaBrowser/Wiki/wiki/Backup

 

Now, since I don't have a Premiere account, that means I have to go the manual route.  Everything is clear to me except the last step in restoring user data.  Here's the section:

 

Restore User Data

Your user data is stored in our old library.db file, and we'll need to run some sql queries to import this into the new library.db in the new Emby Server installation. You'll need a Sqlite database editor such as DB Browser for Sqlite.

You'll need to open the old library.db file, then attach the new library.db file. You can then migrate the data using: REPLACE INTO NewDB.userdata SELECT * FROM userdata

 

Does this mean that unless I know how to use DB Browser for Sqlite that I won't be able to restore user data?  

It feels like this is a very rudimentary question, but thought I'd clarify before I start the migration process.  I thought it'd be as simple as copying the appropriate files, and it is, except it seems for this part...?

 

Thanks for any help.

Link to comment
Share on other sites

Does this mean that unless I know how to use DB Browser for Sqlite that I won't be able to restore user data?  

 

You need to know just a little bit because the instructions for what you need to do are right there.  Just open the old DB attach the new one then run the SQL query you copied above.

 

Or, get a 1 month subscription to Emby Premiere and make it really easy :).

Link to comment
Share on other sites

ashbinder

Thanks for the response; I have actually been giving the Premiere membership quite a bit of thought (not because of the migration) already, but appreciate the assistance.  I've never coded before, so wasn't sure if the instructions were just high level and there was actual coding knowledge required to proceed.

Link to comment
Share on other sites

If you are generally comfortable with the computer I think you will be fine.  Just keep a backup of your old library.db.

Link to comment
Share on other sites

Happy2Play

I could never get those commands to work or I was just doing it wrong, but I found a different route.  Export userdata table from original library.db and import table into the library.db replacing new userdata table (with DB Browser for SQLite).

Edited by Happy2Play
Link to comment
Share on other sites

BAlGaInTl

You need to know just a little bit because the instructions for what you need to do are right there.  Just open the old DB attach the new one then run the SQL query you copied above.

 

Or, get a 1 month subscription to Emby Premiere and make it really easy :).

The bold was going to be my suggestion.

 

:)

Link to comment
Share on other sites

ashbinder

Hi all,

 

I just migrated the database and something seems to have gone wrong.  All my watched data and resume points for all users do not appear.

 

Doing some troubleshooting, I realized that the library was not finished scanning before I did the "restore user data" step.  Could this be why?  Should I just try this step again after the library is done scanning?

 

On a separate note, should I move to the premiere subscription, does it allow just backup and restore of user data, so I don't need to refresh everything else?

 

Thanks!

Edited by ashbinder
Link to comment
Share on other sites

ashbinder

UPDATE: did try running the "restore user step" again to no effect.  Wonder if I'm doing it wrong...I open the new library db, attach the old library db, SQLite asks to "specify the database name under which you want to access the attached database" - am I supposed to leave this blank?  I put in "NewDB" as the name...which now doesn't seem to make sense, but was how I got the REPLACE command to run without error.

 

On a separate note, is it normal that after copying over the metadata and rescanning, that the images for some are different than they were on the original server?  My original metadata was stored in C:\Personal Files\Media Browser Library.  So, after copying over, I noticed that even though I kept that path, the path on the dashboard for the new server is C:\Personal Files\Media Browser Library\metadata.

UPDATE: did try running the "restore user step" again to no effect.  Wonder if I'm doing it wrong...I open the new library db, attach the old library db, SQLite asks to "specify the database name under which you want to access the attached database" - am I supposed to leave this blank?

Edited by ashbinder
Link to comment
Share on other sites

CBers

I recently moved my Emby server to a different physical computer and I took a backup via the plugin on the old PC, set up the Emby on the new PC (adding the libraries etc), let the library scan run.

 

I restored the watched status via the backup plugin on the new PC, after copying the zip across from the old PC.

Link to comment
Share on other sites

Happy2Play

UPDATE: did try running the "restore user step" again to no effect.  Wonder if I'm doing it wrong...I open the new library db, attach the old library db, SQLite asks to "specify the database name under which you want to access the attached database" - am I supposed to leave this blank?  I put in "NewDB" as the name...which now doesn't seem to make sense, but was how I got the REPLACE command to run without error.

 

On a separate note, is it normal that after copying over the metadata and rescanning, that the images for some are different than they were on the original server?  My original metadata was stored in C:\Personal Files\Media Browser Library.  So, after copying over, I noticed that even though I kept that path, the path on the dashboard for the new server is C:\Personal Files\Media Browser Library\metadata.

UPDATE: did try running the "restore user step" again to no effect.  Wonder if I'm doing it wrong...I open the new library db, attach the old library db, SQLite asks to "specify the database name under which you want to access the attached database" - am I supposed to leave this blank?

 

I never got that figured out either.  Did you try what I said in post 5?  Export table userdata to csv from original db and import userdata from csv to the new db.

Link to comment
Share on other sites

CBers

Did you try what I said in post 5? Export table userdata to csv from original db and import userdata from csv to the new db.

What does that give you over and above using the backup plugin?

 

What have I missed?

Link to comment
Share on other sites

Happy2Play

What does that give you over and above using the backup plugin?

 

What have I missed?

 

It covers the users that are not Premiere, since the databases were merged you have to know SQL modding to maintain userdata or become Premiere supporter.

Edited by Happy2Play
Link to comment
Share on other sites

CBers

It covers the users that are not Premiere, since the databases were merged you have to know SQL modding to maintain userdata or become Premiere supporter.

Something like that should be basic, not Premiere.

  • Like 1
Link to comment
Share on other sites

ashbinder

Hi Happy2Play,

 

I actually didn't understand your post until you rephrased it the way you just did...thanks!  Unfortunately, when I tried to import the UserData, I got the following error message: 

 

"There is already a table of that name and an import into an existing table is only possible if the number of columns match."

 

Weird!  I think I may have to cave and at least try a monthly premiere membership, not only for the backup, but I've been thinking about giving Emby Theater a try as well...maybe it'll be better than Kodi...

 

Frustrating though; didn't think it would be this difficult.  

Link to comment
Share on other sites

Happy2Play

What exact steps did you take?  To see if I can reproduce your issue.

 

Here is what I did, copied library.db

deleted/uninstalled Emby Server

Reinstalled Server used previous install username with new setup

Set Libraries which performed library scan

shutdown server

Opened original library.db exported userdata table

opened the new library.db and imported userdata table.

  • Like 1
Link to comment
Share on other sites

ashbinder

Just got Premiere and the User Data transferred perfect.  However, my movies are still a bit messed up.  For example, many of my older movies now show as recently added, even though I copied the Metadata over from my original setup.  Also, some are missing images or are different images than I had manually chosen on my old server.  I thought by copying the metadata over that my movie catalog would be exactly the same, but it's not...is this normal?

 

Happy2Play - those are the exact steps I did (except I installed Emby onto a new computer)!  The only step that failed was importing the userdata table in DB Browser for SQLite, which gave me previous the error message.

Edited by ashbinder
Link to comment
Share on other sites

Happy2Play

Okay,

 

what do you mean you copied Metadata over from original setup?

Link to comment
Share on other sites

ashbinder

The metadata for my old computer was saved in a custom path: C:\Personal Files\Media Browser Library.  I then copied this folder, same path, to my new computer.  Does something get lost in translation when you do this?

Link to comment
Share on other sites

Happy2Play

Sorry but you can't save metadata/library as each server generates new ids for all media.

Link to comment
Share on other sites

ashbinder

Oh!  So was there no value in copying over that folder to the new server?  Because it seems like the new server is using images I never selected before.

 

Questions:

 

1.  so is there no way to retain the "date added" when migrating servers?  It's now hard for me to see what's the latest movie added, as the dates are now changed on the new server?

 

2.  is there any setup option I could have done that would have helped avoid this issue?  For example, was there no benefit to specifying a custom metadata folder?

 

3.  if I change the metadata folder path, does it move everything now in that folder to the default location?  Or does Emby redownload everything?

 

Thanks!

Link to comment
Share on other sites

Happy2Play

Oh!  So was there no value in copying over that folder to the new server?  Because it seems like the new server is using images I never selected before.

 

Questions:

 

1.  so is there no way to retain the "date added" when migrating servers?  It's now hard for me to see what's the latest movie added, as the dates are now changed on the new server?

 

2.  is there any setup option I could have done that would have helped avoid this issue?  For example, was there no benefit to specifying a custom metadata folder?

 

3.  if I change the metadata folder path, does it move everything now in that folder to the default location?  Or does Emby redownload everything?

 

Thanks!

 

1.  Are you saving metadata with media?  If not then all media will use the setting set a "Date added behavior for new content:"  Dashboard-Library-Advanced

 

2.  Only option would be "Save artwork and metadata into media folders".  This path is only good for People, Artists, Genre, Studio, ect images folders (So you would migrate everything in metadata folder except channels, library, and views folder).  All library metadata gets redownloaded unless you save with media.

 

3. No, changing metadata path does not migrate anything you have move stuff manually if you set a custom path or it gets redownloaded.

Link to comment
Share on other sites

ashbinder

Thanks for the clarification - the things you wish you knew when you first started...

 

Much appreciated - sounds like the best way would have been to start my library with all metadata being saved with the media (.  How does that work if I move the file to another folder?  I'm assuming the metadata is named the same as the file, so I would just move it at the same time.

 

So to confirm my understanding, that means if I want to go down this route now (i.e. go into my library and enable saving the metadata with the media), I basically have to start my library from scratch again, right? Because everything is currently in that custom path, it's either that or manually move everything to where the media is saved, which is a pain if your library is a large collection and spread over multiple drives like mine.

Edited by ashbinder
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...