• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question How to change the MySQL and web directory in Plesk for Linux??

speed2

New Pleskian
how to change the MySQL and web directory in Plesk for Linux?

My idea is to have the database on one disk and the Web on another, I have already changed the mail directory, setting in the file /etc/psa/psa.conf.

Disk1 = SO Done

Disk2 = Database

Disk3 = Web

Disk4 = Mail Done
 
Directory for vhosts you can change with transvosts.pl utility:

Code:
# plesk bin transvhosts.pl --help
You should specify destination directory.
Utility to transfer vhosts content from HTTPD_VHOSTS_D directory to new place.

Usage:
        --dest-dir   <path>  Destination path. Path to new vhosts directory.
                             Example: /path/to/new/vhosts.
                             If directory does not exist it will be created.

        --correct-scripts    Changes user scripts.
                             Old vhost path is replaced to new path in content of all files.
 
I created a symbolic link pointing to another disk.

Exemple:

systemctl stop mariadb.service

mv /var/lib/mysql /diskmysql/


ln -s /diskmysql/ /var/lib/mysql

vim /etc/my.cnf
[mysqld]
...
datadir=/diskmysql
socket=/diskmysql/mysql.sock
symbolic-links=1


systemctl start mariadb.service
 
You can move the vhost directory tree, but not a single directory of that only. Here is a detailed description how to move the vhost tree:
 
Back
Top