How to move the vhosts directory in Plesk

- by

Plesk-LogoThe default directory for all web files in Plesk on Linux is /var/www/vhosts. Usually this works well, but if you’d like to use another partition instead, you’ll be pleased to hear that you can!

Parallels (or Odin as we call them now) have written a handy script which moves the content and patches the relevant configuration file and copies all content at the same time. The script is called transvhosts and you can download it here:

Download it using wget and make the file executable:

wget http://kb.sp.parallels.com/Attachments/kcs-12467/transvhosts.pl
chmod +x transvhosts.pl

It’s a PERL script, which means it needs prefixed with ‘perl’ to be called. Say you want to move your vhosts directory to /home/vhosts, you’d call it like this:

perl transvhosts.pl --dest-dir /home/vhosts --correct-scripts

Moving files to new directory...
Correct psa configuration file...
Correct passwd file...
Correct server configuration files...
Clean up symlinks...
/etc/httpd/conf/plesk.conf.d/vhosts
Correct php-fpm pools configuration...
Moving files to new directory...
Correct psa configuration file...
Correct passwd file...
Correct server configuration files...
Clean up symlinks...
/etc/httpd/conf/plesk.conf.d/vhosts
Correct database...
Update hosting settings...
done
Update subdomains settings...
done
Update system users settings...
done
The service node 'local' was successfully updated.
Correct user scripts...

This may take a moment or two depending on the amount of content you have in the current directory. The script will patch Plesk’s configuration file and restart the panel. There’s minimal downtime in involved in this process.



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

3 thoughts on “How to move the vhosts directory in Plesk”

  1. Dang! That’s difficult to troubleshoot remotely. Best put that directory back where it was then.

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.