• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Moving a domain's locally stored database to an external server

Vane

New Pleskian
Hi.

All of the subscriptions on my Plesk have their databases stored locally, on the same server where Plesk is installed. Two or three of the domains (e-commerce stores) are generating quite a bit of traffic overall and I would like to move their databases to an external server. I've already set it up, it's up and running and added to Plesk as a secondary database server.

Here comes the issue though. I haven't found an option to move the existing domain's database to the external server. I could move it manually even, but still, there isn't an option in the Plesk interface to change the db server that the specific, already existing domain uses. Or is there?

I am able to use the external db server for new subscriptions without any issues.
How can I solve this problem?

Cheers
Peter
 
Hi Vane,

there is no such option in Plesk, but it is quite easy to backup the corresponding databases over the command line or over the Plesk Control Panel and import it on your external database - server.


Example:
  1. Database dump over the command line, creating a temporary download folder in your document - root of your domain before the dump:
    Code:
    mkdir -p /var/www/vhosts/YOUR-DOMAIN.COM/httpdocs/temp/backup
    
    plesk db dump DATABASE_NAME > /var/www/vhosts/uwefilthaut.de/httpdocs/temp/backup/DATABASE_NAME.sql
    Now pls. correct the folder and files permissions with for example:
    Code:
    chown -R YOUR-DOMAIN-ADMIN-NAME:psacln /var/www/vhosts/YOUR-DOMAIN.COM/httpdocs/temp
  2. Log in to your external server ( preferably as user "root" ), create a temporary download folder, get the database - dump from your main - server and import the dump to your current, external database.
    Code:
    mkdir -p /root/temp/backup
    
    cd /root/temp/backup
    
    wget http://YOUR-DOMAIN.COM/temp/backup/DATABASE_NAME.sql
    
    plesk db DATABASE_NAME < DATABASE_NAME.sql
  3. Delete the temporary folders and files on both servers, after your successfull import.
 
Dumping the database to another server is not my main concern. The thing is, I would like to force Plesk to stop using the locally stored database and start using the external database INSTEAD. As I've said before, with new subscriptions/domains I can just choose the database server from the dropdown list and it works just fine.

For already existing domains there's simply no option to switch db servers in Plesk UI, so I guess I have to do it manually somehow. But how?
 
You can try to change db_server_id in data_bases table for your dom_id.
db_server_id for your external DB server you can find in DatabaseServers table.
 
Back
Top