How to dump zones remotely from a Plesk Windows server
INFO
Applies to all DNS Manager versions!`
This tutorial explains how to dump zones from a Plesk Windows server.
The recommendations included here apply if you need to use the Remote update function of DNSManager and the zones are held on a Plesk Windows server.
Step-by-step guide
Plesk Windows server
All you need to do is add a new MySQL user that will be allowed to connect remotely to the Plesk database. Here's how:
- Connect to MySQL and run the command below:
grant select on <Plesk_database_name>.* to '4psadnsreader'@'<IP address of the DNSManager server>' identified by '<password used to connect>';
flush privileges;- Then replace the following:
<Plesk_database_name>with the database name, usually psa<IP address of the DNSManager server>with the IP address from where the dump script will connect to the Plesk server<password used to connect>- with the password used for connection
DNSManager server
Log in to your DNS Manager server using your favorite SSH console (e.g. Putty).
Go to
DNSMANAGER_ROOT_D/remote/plesk/bashcd /usr/local/dnsmanager/remote/pleskIn this folder there's a script called
plesk_export.sh. Make a copy of this file where all the changes will be applied.bashcp plesk_export.sh plesk_windows_export.shOpen
plesk_windows_export.shin your favorite text editor and setdump_fileas follows.bashdump_file="/usr/local/dnsmanager/admin/htdocs/dump_full_recs_winsrv.txt"Search for the
get_config()function and replace it with the one below.bashget_config() { #check local vars [ -n "$dump" ]||dump="masters" [ -n "$masters2slaves" ]||masters2slaves="yes" [ -n "$dump_masters" ]||dump_masters="no" [ -n "$dump_allow_transfers" ]||dump_allow_transfers="no" [ -n "$dump_soa" ]||dump_soa="no" [ -n "$dump_reverse" ]||dump_reverse="yes" [ -n "$ignore_dns_zones_status" ]||ignore_dns_zones_status="no" mysql_dir='/usr/bin' admin_user='4psadnsreader' admin_passwd='<Password for connection to the Plesk serevr>' server_host='<IP address of the Plesk Widows server>' server_port='8306' OLDVER='0' domainaliases='domain_aliases' }Replace
admin_passwdwith the correct password andserver_hostwith the IP address of the Plesk Windows server. In case the port where MySQL listens to the Plesk server was changed, make sure the correct port number is added toserver_portparameter.Save changes, then run the following command:
bashsed -i 's/-uadmin/-u$admin_user/g; s/-p$admin_passwd/-p$admin_passwd -h$server_host -P$server_port/g' plesk_windows_export.shRun the dump script, then log in to DNSManager and add a new remote update location.
httphttps://<your_DNSManager_server_IP_address>:8550/dump_full_recs_winsrv.txt