@anon18523487 okay, had some time this morning to run a test. At a high level this is what I done …
- Backup existing /var/lib/plexmediaserver
- Stopped plex and then nuked /var/lib/plexmediaserver
- Started plex, claimed server and applied my specific settings to the server so they matched what it was previously
- Added Movie Library (I use matching id tags for everything so they will match exactly the same)
- Added TV Library (I use matching id tags for everything so they will match exactly the same)
- For TV library I then adjusted the small number of shows custom episode ordering when compared to my library settings
- Force refreshed all metadata for both libraries
Once done I then stopped plex and done the following …
Copied new com.plexapp.plugins.library.db to a temp location
Exported tables from source DB, the one taken in backup at the beginning using "/usr/lib/plexmediaserver/Plex Media Server" --sqlite com.plexapp.plugins.library.db ".output settings-views.sql" ".dump metadata_item_settings" ".dump metadata_item_views" ".dump accounts" ".dump devices"
I then dropped the tables in the new target database and confirmed count was 0…
"/usr/lib/plexmediaserver/Plex Media Server" --sqlite com.plexapp.plugins.library.db
delete from metadata_item_settings;
delete from metadata_item_views;
delete from accounts;
delete from devices;
select count(id) from metadata_item_settings;
select count(id) from metadata_item_views;
select count(id) from accounts;
select count(id) from devices;
.quit
Then imported "/usr/lib/plexmediaserver/Plex Media Server" --sqlite com.plexapp.plugins.library.db ".read settings-views.sql" source export into target db. Ran select counts again to ensure they imported.
Copied db from temp location back to plex main folder, set permissions and ownership and started plex.
The vast majority of things seem okay from what I’ve tested so far. CW, play count and full play history including device names all now appear which is great.
However, the top users and play history graphs on the main dashboard have been reset. For completeness sake is there any way to export and import that data ? Maybe its built off some complex query which is difficult to keep in scenarios like this.