can we change production db settings via script?

Hi everyone,
When deploying, I am attempting to automate my redundancy system as much as possible. So I a
have two complete installs of my project on two servers. Only one is actually used via domain names. The other is hot standby. Both should normally be configured to use same mysql db. All I have to do, in the case of server problem, is to change domain pointing.

The db redundancy is a bit trickier… as I have a periodic shadow copy of the DB made using cron, and that backup loaded into a standby db. ( i know i could use mysql replication for near realtime, but not worth hassles right now). What I want to do is have a script that I could run that would save me from have to hit the manual production settings. I could then change either the production or standby install to use the primary or standby DB.

Anyone doing anything similar?
Thanks,
Jamie

I don’t realy understand what you want to do. But I do have some remarks. If your server fails you need to change dns to point to the new server. But dns changes are slow and could take all day in a worse case scenario. So I wonder if this is a good option for you. What you might consider is using a small site outside of your two servers that forwards the user to the server of choice. Since you only need to forward and use a tiny html page for that it’s very unlikely that this one will fail. You could even create a small maintenance app to set the correct redirect. If one server fails then you can change it by the click of the mouse. If you set a small ping app on both servers you can check the availability of the servers continuously. That’s how I do it…