Updating your Plex video source file paths | arfore dot com

Today while perusing the forums on the Plex website, I noticed someone inquiring as to how they would go about changing the file paths in Plex for one of the video sources without removing the source and adding it back from the new location.

The reason for wanting to do this is to ensure that your database entry tweaks, fanart settings, etc., are not lost, which is what would happen if you removed the source and it’s library entries.

One of the more interesting parts of the Plex project at the moment is the complete re-build of the database structure and how you work with it.  The existing database structure is fairly poor in it’s design.  There are a lot of cryptic field names, and it is easily corruptible.  The current library system is a hold-over from the old XBMC code base.

Regardless of all of that, the task itself is fairly straightforward and easily accomplished with a little care.

The first thing that you have to note is that this should never be attempted on a live Plex database.  Always do this on a backup.  Secondly, this is not a normal end-user type of operation. And finally, performing such an operation could easily wipe out your data if done improperly.  Also, the steps listed below require a certain amount of “non-average” experience with the Mac OS. If you are not comfortable working at the command line using Terminal, then don’t attempt this.

That being said, here ya go:

1. Make a working copy of the database to test with, never work on the original. The video information database is stored here by default:

/Users/USERNAME/Library/Application Support/Plex/userdata/Database/

2. The name of the video database may vary a little. For instance mine is named:

MyVideos34.db

3. Open the working copy using the built-in SQLite3 installation:

sqlite3 MyVideos34.db

4. At this point you will be presented with the SQLite3 command prompt:

SQLite version 3.6.12 Enter “.help” for instructions Enter SQL statements terminated with a “;”

sqlite>