Article ID: 6518, created on Jul 11, 2009, last review on Oct 6, 2016

  • Applies to:
  • Plesk for Linux/Unix


Local databases are databases that are created through the Plesk on a local MySQL server. This is the default database server used by Plesk.

Using the instructions below, it is possible to migrate a local MySQL database between Plesk servers manually.

  1. On the source server, get information about the local databases on the created domain,

    source ~# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa
    mysql> select as domain, as db_name, dbu.login, a.password from domains d, data_bases db, db_users dbu, accounts a where and and and'';
    | domain      | db_name       | login        | password       |
    1 row in set (0.01 sec)  
  2. On the source server, back up the database. You may use the following command:

    source ~# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -uadmin DATADASE_NAME > DATADASE_NAME.dump

    Move the dump to the destination server.

  3. On the destination server, create the database DATADASE_NAME on the domain with Plesk CLI /usr/local/psa/bin/database. Assign the same username and password as on the source:

    destination ~# /usr/local/psa/bin/database --create DATADASE_NAME -domain DOMAIN.NAME -type mysql -passwd DB_USER_PASSWD  -passwd_type plain -add_user DB_USER_NAME -server localhost

    Database creation through Plesk CLI utility /usr/local/psa/bin/database will update the Plesk database with the appropriate username and password. Run the utility with --help option to get a list of all available options. After creation, it is possible to log in to the database through DB WebAdmin in Plesk on the destination server: Home > Domains > > Databases > DATADASE_NAME > DB WebAdmin

  4. On the destination server, restore the content of the database from the dump created on the source server:

    destination ~# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin DATADASE_NAME < DATADASE_NAME.dump ``

a914db3fdc7a53ddcfd1b2db8f5a1b9c 56797cefb1efc9130f7c48a7d1db0f0c 29d1e90fd304f01e6420fbe60f66f838

Email subscription for changes to this article
Save as PDF