Jump to content

Migrate database


revengineer

Recommended Posts

revengineer

I am working on an emby server reinstall and followed the instructions at https://github.com/MediaBrowser/Wiki/wiki/Backup to migrate the userdatas table in the database. However, the instructions are incomplete so I need extra help. When I execute the command

REPLACE INTO NewDB.userdatas SELECT * FROM userdatas

I get the error

table NewDB.userdatas has 10 columns but 11 values were supplied: REPLACE INTO NewDB.userdatas SELECT * FROM userdatas

because the old database contains a field "lastPlayedDate" of type "datetime" which is not present in the new database created by emby server v4. When I delete this field in the old database, I get the error message below.

 

5c4bb259b1e49_201901251.png

 

Can I ignore this message? Or do I need to do this differently? Please advise. Thank you.

Link to comment
Share on other sites

It might be better to migrate 3.5 to 3.5, then upgrade to 4.0

@@Luke, did you mean migrate from 3.5 to 3.6, then upgrade to 4?

Link to comment
Share on other sites

revengineer

It might be better to migrate 3.5 to 3.5, then upgrade to 4.0

 

The current database is already updated to v4, and my understanding is that I can no longer go back. So this field is left over from a past migration. The database was created a few years ago, so I am not sure whether the switch to the newer field that saves the last played date occurred with the v4 release or earlier. In any case, it seems that your suggestion does no longer work.

Link to comment
Share on other sites

revengineer

@@revengineer Do you not have the BACKUP plugin installed?

 

Much easier, although you need to also have Premier.

 

I do have the backup plugin and can use it for porting much of the configuration. It is my understanding from wiki article I linked above that the "played" status is not backed up by the plugin and must be transferred manually. I do not care so much about the status for movies, but I really need this for TV episodes.

Link to comment
Share on other sites

CBers

I do have the backup plugin and can use it for porting much of the configuration. It is my understanding from wiki article I linked above that the "played" status is not backed up by the plugin and must be transferred manually. I do not care so much about the status for movies, but I really need this for TV episodes.

It is backed up, as I've used the plugin to restore watched status many times over the years.

Link to comment
Share on other sites

No mention of using the backup/restore in that thread, just what would happen upon removing library.db.

You could also get back watched status using the Trakt plugin if you had that running previously (and not mentioned in that thread either). 

Link to comment
Share on other sites

CBers

Hm, then I do not understand what the section on "Restore User Data" is for as well as @@Luke comment on the watch data in this post: https://emby.media/community/index.php?/topic/67866-where-are-movie-ids-stored/

I found it easier to install afresh, add your libraries, run the library scan then do the restore.

 

I also pre-created the users before the restore.

Link to comment
Share on other sites

revengineer

It is backed up, as I've used the plugin to restore watched status many times over the years.

 

I completed the emby server rebuild yesterday and you are correct in that favorites and watched status is retained on restore of the backup. The library.db is now a lot smaller (100 MB vs 1 GB). So all seems well.

 

I still do not know what I am missing by not moving the "userdatas" field from the old library. If not significant I rather leave the library as is because I am not sure about any issues arising from the deviation of the wiki procedure mentioned in the OP. @@Luke seemed to not be sure either.

Edited by revengineer
  • Like 1
Link to comment
Share on other sites

revengineer

No mention of using the backup/restore in that thread, just what would happen upon removing library.db.

You could also get back watched status using the Trakt plugin if you had that running previously (and not mentioned in that thread either). 

 

The linked thread was about data in the library.db that is not included in the configuration backups. And no, I did not have Trakt running. What does Trakt store that config backup does not? The watched status seems to be backed up because it was properly restored.

Link to comment
Share on other sites

  • 3 weeks later...

It is backed up, as I've used the plugin to restore watched status many times over the years.

Much easier, although you need to also have Premier. Edited by Happy2Play
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...