Page 1 of 1

Modify restore script to support remote dbs

Posted: Mon Aug 14, 2017 2:28 pm
by benhank
Hey guys is it possible to modify the restore script so that it will restore db's hosted on a different server?
for instance my Prod server has an offloaded mysql db hosted on Remotedbsvr.

If I run the restore script, I would like to have the script restore the mysqldb to Remotedbsvr.
I already have ssh passwordless login enabled on both servers.
Thanks!

Re: Modify restore script to support remote dbs

Posted: Mon Aug 14, 2017 2:40 pm
by scottwilkerson
are you talking about the restore_xi.sh script?

because it does do this, however you need to set the remote system up to allow connections from your IP for the root user, then at the top of the script you need to edit this line with the password for the remote server, replacing nagiosxi

Code: Select all

themysqlpass="nagiosxi"
This is really the only way to do it because the script needs access to the mysql servers root user to drop/restore the databases

Re: Modify restore script to support remote dbs

Posted: Mon Aug 14, 2017 2:54 pm
by benhank
ah ok. Thanks I didnt know that it did it already. you can lock it up.