Question

Looking for some suggestions on best way / possibility of implementing offsite backup of the data in my php app.

So we have an PHP app that runs on the clients local site, which dumps the MySQL data to a datefile.sql each night. what's the best way to get this moved to an external server.

We host a server that currently we manually FTP files to each morning. How best can we automate this, would we need to hard code in FTP credentials, what if we had multiple clients how could we separate out this so no hard coded credentials are needed.

The ideal situation would be to have a MySQL instance running on the external server that the local clients server replicates the data across to this on the fly and back if required. Not even sure that's possible?

Happy to try and explain further if needed.

Thanks,

Any ideas?

Was it helpful?

Solution

you could create a bash script running on your server, called by a cron at night, that uses rsync to fetch the sql file from the clients servers (if you have an ssh connection with them), and restore it on your own machine.

OTHER TIPS

You can achieve this using cron. Just create a cronjob and schedule it to run when you need it to. For all the file-transfering hasle, you may use rsync (which also provides ways to transfer only different data etc).

Also, I think that MySQL has a build-in feature for replication and backups, but I'm not sure about this or how to configure it..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top