On 04 Jan 16:14, Chris Green wrote:
I nearly had a problem just now, having done a clean install (rather than an upgrade) of xubuntu 11.10 I needed to restore sundry mysql databases. Since they're not in /home nor in /etc I thought for a nasty moment I hadn't got backups because /var/lib isn't in my automatic cron backups.
However I had done a one-off copy of the whole of /var before cleaning out the old installation and installing xubuntu 11.10 - phew! :-)
It does make me want to find a sensible way of backing up those mysql databases though. My automatic (cron) incremental backups save /home and /etc. I have made /var/www a symbolic link to a 'home' directory for www-data (the apache UID) at /home/www-data/www so all my web stuff gets backed up too.
The databases are not heavily used so there's a pretty good chance that I can get away with making straight copies of all the files in /var/lib/mysql without causing any disasters but what's the best way to do that? I *could* make /var/lib/mysql a link to somewhere that gets backed up but that really feels like a bit of a bodge. I'd prefer not to add /var/lib/mysql to my backup list though I suppose that's really the sanest way to do it.
I use sqlite for as many databases as possible so that this isn't an issue but some applications insist on mysql (or postgres) and, even though my use is very lightweight and doesn't need a proper *database* backup strategy I need to do something.
Any comments/ideas anyone?
The ondisk format of mysql is not guaranteed to work between architectures, if you've not got much data in it, create a cron job that does a dump of each of the databases in to files, backup the dump directory, job done.