Scheduling a MySQL restore

Webmin’s mysql module makes it super easy to schedule a database backup. I wish it also had a way to schedule a restore. Thank you.

  • Joe


Are you by chance using Virtualmin as well?

If so, you may be able to use Virtualmin, and the command line tools, to accomplish what you’re after.

If you were to generate a backup of the Virtual Server in question – you could use the options available in “virtualmin restore-domain” to restore the database feature of that domain.


Hi Eric,

Yes, I am using Virtualmin GPL. I have used the backup and restore function of Virtualmin. It works flawlessly restoring the whole virtual website or parts of what I want to restore including the database. I have scheduled backup for all of the domains. I even have a scheduled backup for the mysql database separately. I was hoping the developers would also add a way to schedule a database restore just for mysql.

Forgive me, but I’m wondering if a “managed scheduled restore” is a feature that so many users would use… I’m a bit puzzled why you’d want to regularly and automatically restore a backup that’s intended for use when the server crashes? :slight_smile:

Ooh, okay I see. Ever pondered using MySQL Replication for this purpose instead of shuffling full dumps around? :slight_smile:

I have a second web server which pulls via rsync files on the first server which have changed in /public_html. I also used rsync to pull the mysql dump from the first web server. I then run a script which does a mysql restore on the second web server using the most recent mysql dump file.

On the second web server acting as a backup I also have a scheduled nightly backup for all of the websites. Just in case an error gets pulled from the first webs server by rsync I am able to fix it.

But you bring up a good point this will only work if the server was just acting as a backup.

My company is also looking for a solution because we have SaaS demonstration sites that need to be restored on a daily basis. Anyone ever find a solution for this? Thanks!