Article ID: 114468, created on Jul 30, 2012, last review on Jun 19, 2016


I need to quickly restore contents of /var/www/vhosts/domain.tld_ folder for all clients without restoring full backup.


Contents of the mentioned folders are located in dumps folder, which can be found in the following way:

# grep DUMP_D /etc/psa/psa.conf
DUMP_D /var/lib/psa/dumps

Usually it is located in /var/lib/psa/dumps/clients/client_login/domains/domain_name/ and has a name like testbackup\\_vhost\_1207281225.tgz

Vhost folder content for one domain can be restored with this command:

# tar zxvf /var/lib/psa/dumps/clients/<client_login>/domains/<domain_name>/*vhost*.tgz -C /var/www/vhosts/<domain_name>`

To restore vhost directory content for all domains of all clients you may use this script:

echo "select c.login, from clients c join domains d on = d.cl_id;" | MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -Ns | grep -v admin | while read cl dom; do tar zxf /var/lib/psa/dumps/clients/$cl/domains/$dom/*vhost*.tgz -C /var/www/vhosts/$dom/ >& /dev/null; done

Put the above script into a file, for example to /root/

Assign proper permissions: # chmod 755 /root/

Email subscription for changes to this article
Save as PDF