We've got a Virtual Server with full ssh and root access running LAMP on Ubuntu Server.
I've got a small computer in the office running ubuntu that isn't being used for anything.
I thought I should use it to make and store (a copy of) our MySQL database backups. However, how do I go about backing up our databases?
MySQL Workbench locks tables to avoid errors, amongst a host of other features, but does not have any planned automatic backup bits planned. MySQL Dumper doesn't specify that they can keep the database consistent.
Source for information from this paragraph:
I don't see the point of running a php script on my server and emailing the backups when I have SSH access. Since backups are so important, I figure there must be a standard (or awesome) way of doing it I haven't found yet!
So how do I go about backing up our data? And, preferably, our users, config, etc too!
Best Answer
If you have MySQL installed on the Ubuntu machine, you can do the following:
Suppose IP of Virtual is 10.1.2.30
You can the following on the Ubuntu machine
You could crontab this on the Ubuntu machine as well
If you are looking for consistent mysqldumps, you could
FLUSH TABLES WITH READ LOCK;
on the databaseFLUSH TABLES WITH READ LOCK;
and--single-transaction
on the database (See my post https://dba.stackexchange.com/questions/8587/mysql-db-backup-excluding-specific-tables/8613#8613 for some ideas on scripting that)Give it a Try !!!