Page 1 of 1

Backup plex library

Posted: Thu Dec 31, 2015 3:10 pm
by paolozac
Hello to everybody,
on my QNAP TS-451 8TB raid 5 I've recently installed PLEX Server to which I fed about 100,000 media files (photos, movies, and tvseries).
All data folder of QNAP where I keep the media files are already copied to another USB drive attached to the QNAP and I would do the same thing with the library PLEX Server.
Where is located the PLEX library?
How do I map the library to a folder visible from my computer to then copy?
I hope it was clear.
Thanks in advance for your help.
Paul

Re: Backup plex library

Posted: Thu Dec 31, 2015 5:33 pm
by paolozac
Hi Philippe,
I thank you for the answer but i'm not an expert and so your message is not very clear.
The cd.... is a command? where have i have to type this command?
I use the qnap nas from a mac OS X computer.
Thanks again
Paolo

Re: Backup plex library

Posted: Tue Feb 21, 2017 5:17 am
by guitarburke
Hello,
I was able to successfully back up my Plex library following the steps above. I'm having trouble using the 'cp' command specified in 'in case of restore'
- drive saved to: USBDisk1/Databases/Plex Media Library
- Plex Install Path: /share/CHACHEDEV1_DATA/.qpkg/PlexMediaServer
any help with the specific commands is greatly appreciated

Re: Backup plex library

Posted: Tue Feb 21, 2017 8:17 pm
by guitarburke
Thanks for the reply. This is what I have back from my NAS after ssh admin login:

[~] # cd "USBDisk1/Databases/Plex Media Library"
-sh: cd: USBDisk1/Databases/Plex Media Library: No such file or directory
[~] # cd "/USBDisk1/Databases/Plex Media Library"
-sh: cd: /USBDisk1/Databases/Plex Media Library: No such file or directory
[~] # cd /USBDisk1/Databases\Plex\ Media\ Library
-sh: cd: /USBDisk1/DatabasesPlex Media Library: No such file or directory
[~] #

I know it's a pretty basic command, I think I'm missing one little piece to make it work.

Re: Backup plex library

Posted: Tue Feb 21, 2017 8:19 pm
by guitarburke
I was able to cp to the drive:
cp "/USBDisk1/Databases/Plex Media Library"
cp: missing destination file operand after `/USBDisk1/Databases/Plex Media Library'
Try `cp --help' for more information.

but I'm not sure how to string the command back to the NAS at
/share/CHACHEDEV1_DATA/.qpkg/PlexMediaServer

Re: Backup plex library

Posted: Wed Feb 22, 2017 7:25 am
by guitarburke
It took a couple of tries, but it amounted to doing smaller steps each time to verify result was working. This one worked, now that I look at your original solution, makes sense perfectly.

[~] # cd /share/USBDisk1
[/share/USBDisk1] # cd Databases
[/share/USBDisk1/Databases] # cd Plex_Media_Server
<a_Server] # cd $(getcfg PlexMediaServer install_path -f /etc/config/qpkg.conf)
<iaServer] # cp -pPR /share/USBDisk1/Databases/Plex_Media_Server/* Library/

Re: Backup plex library

Posted: Wed Feb 22, 2017 7:43 am
by OneCD
guitarburke wrote:It took a couple of tries, but it amounted to doing smaller steps each time to verify result was working.
Nicely done. ;)

Re: Backup plex library

Posted: Mon Dec 10, 2018 6:34 am
by jknight2
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)!

Original post by Philippe