• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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