PeteGul 34 Posted September 29 Posted September 29 (edited) Hi Maybe an impossible question, but hope not. Is there a way for me to restore my collection from the backed up DB file, into my new DB file? Asked ChatGPT, but I don't really know anything about this. So I'm not sure if I should try? This is what ChatGPT told me: Make a backup first Make a copy of the current beta library.db (e.g. library_beta_backup.db) so you can roll back if something goes wrong. Open old library.db Use an SQLite tool, e.g. DB Browser for SQLite Open old library.db (the one from before beta). Find the collection tables In Emby, relevant info is stored in a few tables: Collections – the collections themselves (name, description, etc.) ItemCollections – the link between the movie/series and the collection Items – the movies/series (used to know which IDs are linked to the collections) You mainly need Collections and ItemCollections. Export the collections In the SQLite tool: Select Collections → Export → SQL or CSV Select ItemCollections → same export Alternatively, you can write SQL to retrieve all collections and their associated item IDs: SELECT c.Id as CollectionId, c.Name, ic.ItemId FROM Collections c JOIN ItemCollections ic ON c.Id = ic.CollectionId; This will give you a list of collections + which item IDs belong to them. Import to beta library.db Open beta library.db in SQLite. Before importing: check that IDs from the old database do not clash with existing ones. Insert the collections and links (Collections + ItemCollections) from the old database into the beta database. Important: Use INSERT or UPSERT, do not overwrite the entire table, to keep existing data in beta. Restart Emby After importing, restart the Emby server. The collections should now appear with the correctly associated movies/series. And this was an example for and SQL script for automation: -- Åpne beta library.db først -- Kjør deretter dette for å koble inn gamle databasen: ATTACH DATABASE 'C:\sti\til\gammel\library.db' AS olddb; -- Sett inn samlingene (Collections) INSERT INTO Collections (Id, Name, Overview, PrimaryImageItemId) SELECT Id, Name, Overview, PrimaryImageItemId FROM olddb.Collections WHERE Id NOT IN (SELECT Id FROM Collections); -- Sett inn koblingene (ItemCollections) INSERT INTO ItemCollections (CollectionId, ItemId) SELECT ic.CollectionId, ic.ItemId FROM olddb.ItemCollections ic JOIN olddb.Collections c ON ic.CollectionId = c.Id WHERE ic.CollectionId NOT IN (SELECT CollectionId FROM ItemCollections); -- Når ferdig: DETACH DATABASE olddb; Is it possible at all to do this? What happen was; mowing to det beta server. Everything is working good, but did not check my own made collections. And we now coming closer to Christmas (as an example, you know, wife and so on :_) ), now that collection is missing, and we see that the other ones are to. So, is this an possibility to restore them without destroying everything else? Edited September 29 by PeteGul
Luke 41257 Posted September 29 Posted September 29 Hi, this is not a process that we are testing, so I don't know what will happen if you try it. Therefore I can't really recommend it. Have you taken a look at this? Backup & Restore
PeteGul 34 Posted October 1 Author Posted October 1 I used that to move everything over to the Beta. But did not get the "backup" of my own made collections.
Luke 41257 Posted October 2 Posted October 2 4 hours ago, PeteGul said: I used that to move everything over to the Beta. How exactly did you do this?
PeteGul 34 Posted October 4 Author Posted October 4 Used the backup and restore plugin, and used the "full" backup. And when I restored for the emby beta I selected the full backup.
Luke 41257 Posted October 14 Posted October 14 On 10/4/2025 at 9:00 AM, PeteGul said: Used the backup and restore plugin, and used the "full" backup. And when I restored for the emby beta I selected the full backup. OK so why isn't the restore enough by itself? Why do you need to do sql queries after that?
PeteGul 34 Posted October 14 Author Posted October 14 It didn't restore my self-made collections. I have to do them over again.
Luke 41257 Posted October 14 Posted October 14 What makes you think that it didn't? It takes the entire database so it should all be there.
PeteGul 34 Posted October 14 Author Posted October 14 I can't find them anywhere, in search or anything. Then I think they are lost. It's two collections, so my wife and I should manage to make them again. But this time, I will add a tag I think so it will be saved in the NFO.
Luke 41257 Posted October 22 Posted October 22 On 10/14/2025 at 12:51 AM, PeteGul said: I can't find them anywhere, in search or anything. Then I think they are lost. It's two collections, so my wife and I should manage to make them again. But this time, I will add a tag I think so it will be saved in the NFO. OK please let us know how that goes. Thanks.
PeteGul 34 Posted October 28 Author Posted October 28 Hi I ended up using tMM to mass add my tag in the .nfo file. So now the tag i searchable. And my better half's collection, she will fix it her self. I don't use tMM to download anything, just create .nfo and rename my files and folders with tmdb id and videoformat (resolution). Just so Emby find it easy and not so much mess in the filenames etc. Haven't tested it much, but the built in Metadata Manager in Emby looks good and works quite nice. But for me it lack the possibility to change filename to the scraped name and the bulk edit. Or is this somewhere I haven't found it? Would also be nice with a search in the Metadata Manger, that don't "jump out" of the manager, alongside with the images on the right side of the metadata (red making) as an easy way of changing them etc. Else, love for Emby 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now