As mentioned in the release notes, PMS 1.40.x introduced several database changes.
You may want to make a backup of the existing database and check for database corruption before updating. If the database is corrupt, the PMS update may fail.
Also, optimize the database before updating. Doing so could speed up the migration process.
After updating, you may see the “503 maintenance” message while Plex performs database maintenance. The process may take several minutes to complete. The message does not auto-update, so close / re-open the browser window recheck the status. Do not stop PMS while it is performing the maintenance. Doing so will restart the process from the beginning.
Additional Info:
- Backup the database
Not necessary if Plex is scheduled to make a backup every three days (Settings → Scheduled Tasks).
- Stop Plex Media Server
- Using File Station, navigate to the Plex Data Folder. Make a backup of the
.../Plugin-Support/Databasesfolder (copy it to a location outside the Plex Data Folder). - Start Plex Media Server
- Check for existing database corruption.
- Stop/restart PMS. Wait 2 - 3 minutes for it to fully start and log the startup sequence.
- Pull the server log files (Settings → Troubleshooting) and unzip.
- Look in Plex Media Server.log for any ERROR entries that mention the database is corrupt or malformed.
Example:
Feb 16, 2024 10:33:56.798 [140079610399376] ERROR - SQLITE3:0x80000001, 11, database corruption at line 70168 of [a29f994989]
Feb 16, 2024 10:33:56.798 [140079610399376] ERROR - SQLITE3:0x80000001, 11, database disk image is malformed in "PRAGMA cache_size=2048"
- If necessary, repair the database.
Option: Plex DBRepair Utility
If you are familiar with the Linux CLI, use the Plex DBRepair Utility [Download].
Run it as root. Use the AUTOMATIC option. If it runs into problems importing the database, try the IGNORE option.
If the repair fails, try the REPLACE option, to restore a backup copy of the database.
Option: Restore from backup with FileStation.
If you are not comfortable with the Linux CLI, you can try to restore from a backup using Synology File Station.
Note that this procedure does not check for database corruption, so it is possible that the backup may also be corrupt.
See FAQ 30 - DSM 7 - Database Repair using a Backup copy.
- Optimize the database
Good: Settings → Troubleshooting → Optimize Database
Better: Use the PlexDBRepair Utility. Use the AUTO option.