Say you have 2 Movie Libraries you created and want to Merge them without losing your collections, Metadata, Sorting options ect. I think the option to Merge libraries would be awesome in this regard so you don’t have to delete a library, then go back and try to replace all the Metadata, sorting and collections you have in place.
Go to your movies library (call it library 1) in dashboard, hover over it and select … then edit. Select Add Folders. Add the path to your 2d movies library path. Once done and replicated you will have all movies in library 1 with metadata, and the original 2d library with its subset of movies. Once the process is completely done you can leave the 2d library or delete it and everything would be retained in library 1, although I don’t think the collections would transfer.
I am pleased to inform that I have found a method to merge libraries without losing metadata, by editing the Plex database.: com.plexapp.plugins.library.db
First of all, stop PMS and backup the Database directory Plex Media Server\Plug-in Support\Databases
in library_sections table, there is the association from librairy (name) and id
in directories table, there is the association from each path to library_section_id (the id of the first table)
in metadata_items table, there is the association from each item to library_section_id (the id of the first table).
To merge one library (id1) into a second one (id2), only 2 sql queries are needed :
update directories
set library_section_id = id2 where library_section_id = id1
update metadata_items
set library_section_id = id2 where library_section_id = id1
Then just after starting PMS, add the path of the library 1 to the library 2. Libray 1 is normaly empty. Remove Library 1.
That’s all. Library 2 includes all items of the previous library 1 with all its personnal metadata
If the paths of the libraries 1 and 2 have the same root, don’t replace the path of library 2 by the root path, because PMS will remove the path of library 2, rescan the path and will lose its previous metadata.
In fact I don’t find the way to create in database a new library_section because there is somewhere (probably outside the database) the information of a library_section with in particular its complete path. The directories table only use the relative path from the library_section path. If someone has the information, I am interested in…
Another use of “merge libraries” could be if you have remote libraries. Me and a couple of friends have access to each others libraries. Today you need to manually switch server in settings to access each of them. It would be awesome to have the option to treat them all as one merged library. As far as I know that’s not possible today, or am I missing something?