Move a Server without losing Data
I had my music library on a Synology NAS and was quite happy with it - till I discovered plexamp and its sonic analysis feature which cannot be used on an ARM cpu like mine. I decided to move the server to a powerful windows system, did the sonic analysis there and moved the whole library again to a linux mini pc - including the sonic analysis files. The files themselves are still kept on the NAS.
You have to copy the database and change the path structure like this (steps for moving from a Synology Nas (Server 1) to windows PC (Server2) , if you want to move from windows to linux, the path structure is of course the other way around.
- Set up server 2, create new library pointing at the files on the NAS, start search and cancel immediately after.
- Turn off „Empty recycle bin automatically“
- Note root path by looking at a file, you need that later on.
- Stop both! servers.
- Create a Back up to a new folder with file station. The Database is found /var/packages/PlexMediaServer/shares/PlexMediaServer/AppData/Plex Media Server/Plug-in Support/Databases. Don‘t touch original database just in case something goes wrong. Also backup folders metadata and media.
- Adjust paths. Use "DB Browser for SQLite" (sqlitebrowser.org), SQLiteSpy is recommended in forums, but it did not work.a) Open the database com.plexamp.plugins.library.db, which can be found in Windows in the folder appdata/local/Plex Media Server/Plug-in Support/Databases. Click on the tab „Browse Data“.b) Then go to the section_locations table and change the root path as required for the new server.c) Change all single entries, because the slashes have to become backslashes. Also the root location is different. For a Music library, you have to go to the section „media_parts“ and there to the column „ file“ Replace slashes with backslashes using the commands update media_parts set file = replace(file, '/', '\');and e.g. update media_parts set file = replace(file, '/drive1', 'D:');.
- Save (very important! The UI looks like it automatically saves changes, but it doesn‘t)
- Replace .db on server 2. You may also replace Media and metadata which were backed up in step 2. If you have already sonic analysis files, move that folder too.
- Restart server 2 and compare.
No comments:
Post a Comment