Backup and restoration of qnap plex directory

My question is directly regarding backing up and restoring the database.


I read in a recent post of using winscp to connect via sftp in order to backup the database.


How would you restore the backed up database after a fresh format of the qnap with plex reinstall. Do the media files need to be in place prior to restoring the database?


Based on how straight forward and reliable backing up and restoring my plex database will be, I will be able to cancel a terribly slow raid migration and start from scratch with piece of mind that plex won’t be affected.


Running latest plex x86 release

Plexpass so I have scheduled tasks, however would also prefer having a separate external backup.

You are getting it wrong here.....

Plex eco-system contains the following:

  • The database
  • All your medias
  • The library folder, with everything in it

The butler provided database backup is merely there if you have a database corruption, and nothing else!

If you instead are talking about a complete restore after a disk crash/reformat, then you'll need all of the above....

So suggest you start by reading this thread:

https://forums.plex.tv/topic/70739-plex-backup/?hl=backup

Best Regards

Tommy

You are getting it wrong here.....

Plex eco-system contains the following:

  • The database
  • All your medias
  • The library folder, with everything in it

The butler provided database backup is merely there if you have a database corruption, and nothing else!

If you instead are talking about a complete restore after a disk crash/reformat, then you'll need all of the above....

So suggest you start by reading this thread:

https://forums.plex.tv/topic/70739-plex-backup/?hl=backup

Best Regards

Tommy

Thanks for the response, going forward I believe i'm going to schedule monthly backups of the plex database to ensure integrity in the extreme event something happens where I need to restore it. In my case i'll simply backup the PlexMediaServer directory which for qpkg based plex installations holds all plex data. 

Backup and Restore of Plex Media Server for QNAP (Linux) for fellow Noobs with CLI - Original post by Philippe from QNAP Forum

You need to open a console to access the QNAP system Command Line Interface (CLI) I can not see how to do it with the QNAP Web Page file copy interface
… you can use telnet client (PUTTY for PC)
… after validating telnet server in QNAP’s admin menu (Telnet access must be Turned On for this to work)
… you can use SSH (best) client … also after validating in Web admin (same menu as telnet)
… REMEMBER commands for file and folder name, in Linux, are case dependent … so Plex is not plex
… cd command is to change the working directory … $(…) is to use the result of the command in parentheses … here I get the path used by the QNAP to install Plexmediaserver … On house keeping, if you share your old Plex with friends and family you may need to get those emails prior to full deletion of old plex
… Assumption: You have already installed through the web interface the SAME version of PLEX APP on the new QNAP system to create ALL the right folders for you

From: Console on FIRST (Source) QNAP

At this point you should be looking at the screen of PUTTY or other Terminal program and have the “[~] #” Prompt after logging in

[~] # mkdir /share/Public/my_plex_library (this will create a folder for a save of your Library that you can easly access)
then each time you want to save your Library (Future steps for doing a REAL full backup of PLEX Files (This is NOT a quick process depending on PLEX size)
[~] # cd {to installation path for Plex} should be /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/
[~] # cp -pPR Library/* /share/Public/my_plex_library (this will copy all file and folder in Library folder to a visible folder in Public share)
… after do a save, using this accessible folder … as you want (archive, zip, cp, FileStation, etc.)

Because I have both QNAPs on the same network, for me I used FileStation 5 (QNAP Utility to Remote Mount the Public Share on the New QNAP then Drag and Drop copy)

To: Console on SECOND (Destination) QNAP

[~] # cp {from folder, archive, usb … to} /share/Public/my_plex_library (or what ever)
[~] # cd {to installation path for Plex, should be} /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/
Now you can cp {copy} back to the new Library folder
[~] # cp -pPR /share/Public/my_plex_library/ Library/*

-pPR said : p = preserve the access right ; P preserve the link (if some exist inside) ; R copy also all sub-folder and contents (recursive).

My copy took hours - 22GBs and 500K Objects! I also found that since I have upgraded PLEX over 20 times that I just needed to rebuild from scratch (Days to get all the Metadata)!

@ByteKnight

Even though I have the DEEPEST respect for Philippe and his skills, I STRONGLY suggest you use rsync instead of cp command, since with that, you can:

Abort at any time you want, and then resume later
Rerun, and backup dir will be updated with only the changes

RSync man page: https://linux.die.net/man/1/rsync