How to add an existing database to Plesk from a remote MySQL server to a subscription?
Connect to the remote MySQL server over SSH
Create a dump of the required database on remote MySQL server:
# mysqldump -u<username> -p<password> db_name > /root/db_name_backup.sql
db_name – database name
<username> – user name for remote MySQL server
<password> – password for remote MySQL server
Download database dump file from remote MySQL 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 [email protected]:/root/db /home/johndoe/
203.0.113.2 – IP address of remote MySQL
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) .
Import backup file
db_name_backup.sqlcreated 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
db_name2 – is the name of the database created in step 4.