Jump to content


Photo

Problem with library.db migration

On same version emby server migration database

  • Please log in to reply
8 replies to this topic

#1 frandan OFFLINE  

frandan

    Member

  • Members
  • 11 posts
  • Local time: 10:27 AM

Posted 15 February 2020 - 05:11 PM

Hi to everyone.

I moved my media to a new server and i followed the migration guide linked on github.

On my old server was running emby 4.3.1.0, the same that i installed on the new one.

I made a manual backup and it was all ok until i tried to restore the usaerdatas table from the old library db to the new one.

The problem is that the old db has more columns that the new one in the userdatas table (14 vs 12)

There is a way to fix this problem?
Thanks in advance for your answers.

@Happy2Play

@arrbee99

@chef



#2 Happy2Play OFFLINE  

Happy2Play

    Trial and Error

  • Moderators
  • 18539 posts
  • Local time: 03:27 AM
  • LocationWashington State

Posted 19 February 2020 - 06:02 PM

Ideally you would use the Server Configuration backup plugin to backup users and userdata to be restored into a new database, but requires Premiere.

 

But to the issue, the database table continues to evolve and as you have noticed columns have changed over different versions.  So the only way the database table merge method will work is if you are merging databases of the same version.

 

Since a plugin can do it I would assume there could be a way to manually do it, but I could be wrong.

 

some more discussion here.

https://emby.media/c...watched-movies/



#3 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 153639 posts
  • Local time: 06:27 AM

Posted 20 February 2020 - 04:04 PM

@frandan what version were you running before?

#4 frandan OFFLINE  

frandan

    Member

  • Members
  • 11 posts
  • Local time: 10:27 AM

Posted 21 February 2020 - 03:32 PM

The two dashboards (the old one and the new one) show the same version : 4.3.1.0 but the tables on the two server are different



#5 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 153639 posts
  • Local time: 06:27 AM

Posted 21 February 2020 - 03:42 PM

The new database doesn't use those two columns anymore so you can ignore them if you're writing your own sql code to migrate the data. Does that answer your question?



#6 frandan OFFLINE  

frandan

    Member

  • Members
  • 11 posts
  • Local time: 10:27 AM

Posted 22 February 2020 - 10:39 AM

I tried with this query "REPLACE INTO librarynew.userdatas SELECT UserDataKeyId, userId, rating, played, playCount, isFavorite, playbackPositionTicks, LastPlayedDateInt, AudioStreamIndex, SubtitleStreamIndex, RatingLastModified, PlaystateLastModified FROM userdatas" but i obtained an error on column "RatingLastModified" that in the new database must be "NOT NULL" and in the old one not.

 

Upgrade: I filled Ratinglastmodified and PlaystateLastModified column with not null values but when i try the query i obtain a "FOREIGN KEY constraint failed" error

:(  


Edited by frandan, 22 February 2020 - 11:09 AM.


#7 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 153639 posts
  • Local time: 06:27 AM

Posted 23 February 2020 - 03:29 PM

What platform are you running emby server on? I'm guessing you don't have your old version installation anymore, right?



#8 frandan OFFLINE  

frandan

    Member

  • Members
  • 11 posts
  • Local time: 10:27 AM

Posted 28 February 2020 - 10:14 AM

Excuse me for the late answer.

My emby server is running on windows 10 pro 64bit.

No i don't have my old installation more: i have only the backup of library db.



#9 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 153639 posts
  • Local time: 06:27 AM

Posted 28 February 2020 - 10:46 AM

Are you still having an issue with the database?





Also tagged with one or more of these keywords: On same version, emby server, migration, database

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users