I had to extract a single database record from a Plesk backup today. The backup utility within Plesk 7.5.4 is not intended for accessing like this. It’s designed to restore a whole domain at once rather than getting hold of mistakenly deleted items, but with a few tools and a modicum (JCB) of patience, it can be done.
The backup file is a mime-encoded, part gzipped file which contains an xml file as an index.
You first need to unencode it using something like ripmime.
Download the latest stable version, unzip and install it following the instructions in the contained ‘INSTALL’ file.
# wget http://pldaniels.com/ripmime/ripmime-1.4.0.7.tar.gz
# tar -zxvf ripmime-1.4.0.7.tar.gz
# cd ripmime-1.4.0.7
# make
# make install
Then you can unencode your backup file. Move to a location where you have plenty of space to work… typically a user’s home directory, and start the unencoding.
On my server ‘backupfile’ was stored as ‘/var/lib/psa/dumps/domain.tld/domain.tld_yyyyy.mm.dd_hh.mm’
# cd ~username
# mkdir restoredir
# cd restoredir
# ripmime -i backupfile -v --name-by-type --postfix
This should create a fair few files in the directory ‘restoredir’. They will be named according to their contents, and you can see whether the files are gzipped or not using the ‘file’ command. All application-x-dir files are tar.gz files of the backed up directories. Hopefully this will be enough for you to determine the files you are after. You can also open up the text-xml1 file to help with ascertaining the correct files.
# file *
# cat text-xml1
Once you’re settled on the ones you want.. in my case ‘application-x-mysql-dump55′.. you can rename them to have the correct file extension and unzip them.
# mv application-x-mysql-dump55 application-x-mysql-dump55.gz
# gzip -d application-x-mysql-dump55.gz
Hope this works out for you.. it proved handy for me anyway.
References:
Original tip in a SWSoft discussion thread
http://forum.swsoft.com/showthread.php?threadid=23669
ripMIME - unencodes MIME files
http://pldaniels.com/ripmime/ripmime-1.4.0.7.tar.gz