Restore / uncompress a plesk backup file using terminal
Today I was had to move a few web sites from one server to another. As I did not have ssh or ftp access to it, the only way to do it was through Plesk. As I don’t have experience using Plesk, I did not know that Plesk’s built in File Explorer can only be used to manage your web site’s files within the server, but it does not let you download those files. So, looking around Plesk’s admin interface I found the backup feature. That looked promissing, so I clicked on it and it brought me to another page called “Backup Manager”. This page allows you to set up periodic or one time backups. Backups can be saved in Plesk’s local repository or in an external FTP server. So I set up all the FTP details and start the backup. Once the backup finished I tried to open it on a linux box and file-roller gave an error when it tried to extract it. A `file` showed that the file was indeed in gzip format.
$ file mydomain.com_2009.11.02_13.07 mydomain.com_2009.11.02_13.07: gzip compressed data, from Unix, last modified: Mon Nov 2 13:08:11 2009
Being a gzip file I obviously tried to gunzip it, but again no luck
$ gunzip mydomain.com_2009.11.02_13.07 gunzip mydomain.com_2009.11.02_13.07 gzip: mydomain.com_2009.11.02_13.07: unknown suffix -- ignored
After googling around for a quite a while I did not find out what this “unknown suffix” error meant, but instead I found on the Parallels Knowledge Base how to do it. I’m copying/pasting it below for future reference:
II. SECOND WAY:
It can be done using mpack tools to work with MIME files. This packet is included into Debian:
# apt-get install mpackFor other Linux systems you can try to use RPM from ALT Linux:
ftp://ftp.pbone.net/mirror/ftp.altlinux.ru/pub/distributions/ALTLinux/Sisyphus/files/i586/RPMS/mpack-1.6-alt1.i586.rpm
or compile mpack from the sources: http://ftp.andrew.cmu.edu/pub/mpack/.
– Create an empty directory to extract the back up file:
# mkdir recover
# cd recoverand copy backup into it. By default Plesk backup is gzipped (if not, use cat), so run zcat to pass data to munpack to extract content of directories from the backup file:
# zcat DUMP_FILE.gz > DUMP_FILE # cat DUMP_FILE | munpackIn result you get the set of tar and sql files that contain domains’ directories and databases. Untar the needed directory. For example if you need to restore the httpdocs folder for the DOMAIN.TLD domain:
# tar xvf DOMAIN.TLD.htdocs
That did it, after untaring the htdocs file I finnaly got what I wanted. Hope that saves someone some time.










