Plesk

How to add an existing database to Plesk from the remote MySQL/MariaDB server to a subscription

Question

How to add an existing database to Plesk from a remote MySQL/MariaDB server to a subscription?

Answer

  1. Connect to the remote MySQL server over SSH

  2. Create a dump of the required database on remote MySQL/MariaDB server:

    # mysqldump -u<username> -p<password> db_name > /root/db_name_backup.sql

    where:
    db_name - database name
    <username> - user name for remote MySQL/MariaDB server
    <password> - password for remote MySQL/MariaDB server

  3. Download database dump file from remote MySQL/MariaDB server to your local computer:

    To download the file to a computer with Windows use WinSCP

    To download the file to a computer with Linux use command line SCP tool:

    # scp username@203.0.113.2:/root/db /home/johndoe/

    where
    203.0.113.2 - IP address of remote MySQL/MariaDB

  4. Log in to Plesk UI and create an empty database with a name that does not exist on the external server:

    Navigate to Subscriptions > example.com >  Databases > Add Database (choose external database server) .

    000000040.JPG

  5. Import backup file db_name_backup.sql created on step 2 to the database created on step 4:

    Navigate to Subscriptions > example.com >  Databases > db_name2 > Import Dump  > select file with database dump and press OK

    where:
    db_name2 - is the name of the database created in step 4.

Exit mobile version