Can't remove folders from library after having moved data to new drive

Server Version#: Version 1.31.0.6654

I have recently moved my libraries around to new drives and can’t delete the old path from the libraries. For example, I had movies in the M:/MOVIES and have now moved all of the files to H:/MOVIES. Both paths appear under my Movies library however when I try to remove the old path (that is now pointing to an empty folder), it won’t let me save the change, giving me an error :‘Your changes could not be saved’. Because of that, Plex sees duplicate entries for each movie and marks them all as Unavailable as it seems to give precedence to the old file location (click the Unavailable tag lets me manually delete the old entry and that fixes it but I can`t do that 1 by 1 for my whole library).

I have:

Rebooted the server multiple time, both the software and actual PC
Emptied Trash
Re-scanned the libraries multiple times
Refreshed all meta-data
Optimized DB
Recreated the old folder structure and added a random file in the hope it might help

Non of the above fixed anything. This problem is the same for my Movies, TV Shows and music library - Plex won’t let me remove the old paths/folders.

Hoping to resolve this. Thanks!

Put a small .txt file into the now empty folder as a workaround.

Before trying, stop and restart your server, Then reload the web app in your browser (F5).

If these are local drives, why not simply swap their drive letters in the Computer Management control panel of Windows? (while Plex server is shut down. If done this way, Plex won’t even notice that something has changed.)

I have tried adding a movie file back to the old folder structure and rescanned, didn’t work.

I have also restarted the server multiple times, and the actual PC and the same Your changes could not be saved error message appears. Only when I try to remove folders from the library I had previously deleted. That’s why I thought recreating them might help but it did not.

Are you using a locked-down web browser, like Brave etc.? Don’t.
Do you have any web browser add-ins activated? Disable them and try again.
Are you using the hosted web app?
Try You need to reclaim your server, but don't dare to touch the Windows Registry

No addins, no locked browser, starting the web app directly from the server itself. I’ve resorted to recreating the library from scratch under another name as the problem was not adding the new media but removing the old links. Not ideal but only thing that worked. I also tried rebuilding the DB

It seems like Plex won’t let me delete entire Libraries either. I do not get an error message but the Library still shows up even after a complete reboot.

Deleting large libraries can take several minutes. Even if the status display is timing out, let the server run until all disk activity has ceased.

Rebooting the server during heavy database activity like this is a recipe for a damaged database. Which may lead to further erratic behavior or even total loss of Plex library data.
It can’t hurt to verify the health of the database now: https://support.plex.tv/articles/repair-a-corrupted-database/

Thanks for the support @OttoKerner , much appreciated.

I had already gone through the motions of DB rebuild but did it again.

This time however when I restarted my Plex Server, all my libraries were gone - complete wipeout. When I tried to add a new Library (figured I’d start from scratch), I was met with the same error message after add the wanted path - Your changes could not be saved. I have a backup of the old db still but know the issue seems to persist with a blank db might help find a solution, I hope so.

Here are the errors found (probably not very meaningful):

sqlite> PRAGMA integrity_check;
*** in database main ***
Page 251504: btreeInitPage() returns error code 11
On tree page 280 cell 1: Child page depth differs
Page 251503: btreeInitPage() returns error code 11
Page 1769: btreeInitPage() returns error code 11
On tree page 12068 cell 5: Child page depth differs
On tree page 12068 cell 4: Child page depth differs
Page 33600: btreeInitPage() returns error code 11
On tree page 33602 cell 8: Child page depth differs
Page 33598: btreeInitPage() returns error code 11
Page 33597: btreeInitPage() returns error code 11
Page 33596: btreeInitPage() returns error code 11
Page 33595: btreeInitPage() returns error code 11
Page 33594: btreeInitPage() returns error code 11
Page 33593: btreeInitPage() returns error code 11
Page 33592: btreeInitPage() returns error code 11
Page 33591: btreeInitPage() returns error code 11
Page 33590: btreeInitPage() returns error code 11
Page 33589: btreeInitPage() returns error code 11
On tree page 33602 cell 7: Child page depth differs
Page 33579: btreeInitPage() returns error code 11
On tree page 33602 cell 6: Child page depth differs
Page 33558: btreeInitPage() returns error code 11
Page 33537: btreeInitPage() returns error code 11
On tree page 33602 cell 3: Child page depth differs
Error: database disk image is malformed
sqlite> VACUUM;
Error: database disk image is malformed
sqlite> REINDEX;
Error: database disk image is malformed

This means that the repair wasn’t successful. Unfortunately a successful repair is not guaranteed.

Try the repair steps with one of the backup copies of the database: https://support.plex.tv/articles/202485658-restore-a-database-backed-up-via-scheduled-tasks/

Wow! That seems to have worked. I can now edit my libraries, I have removed the old paths and added the new in and Plex seems to be doing its thing. It’ll take a long time, require some cleanup and massive metadata rebuild but at least, something is happening. I’ll let you know once everything is done but at least that’s a step in the right direction.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.