The title says it all-- It makes backup schemes a lot easier if the DB’s were stored in the users’ homedir. Or a symlink would also be nice.
Well, Virtualmin backups already can include the full user databases, and include the database dump in the backup file by default.
Also, since the database files are owned by the Virtual Server group, they count towards the quota.
And you can’t simply copy database files as-is for backup purposes, without either stopping MySQL, or first locking the tables. And if a hosting customer thought they could, they’d have a rough day when they tried to restore from such a file
With all that in mind, is there an advantage to using something like symlinks to store database in the users home directory?
Well, all the user data would be placed in the homedir- making not webmin backups a lot easier- like RSYNC to another server.
That’s the catch though, the database files can’t just be copied like another file. They’re open files that could be modified by MySQL at any time.
To get a consistent backup, you have to lock the tables, or use a tool that locks the tables for you.
Some of that is described here:
Rsync is an awesome tool, but rsync can’t guarantee a consistent database backup – another tool needs to be involved (or a database lock needs to be performed before running the rsync).
That’s true- I make db backups through the Mysql module of webmin and that’s actually quite nice.
I’ll offer that I’ve had great luck with “mysqlhotcopy” – it’s an excellent command line tool that you can use to make database backups. It’s described here:
Also, Virtualmin has a built-in backup mechanism for all the Virtual Servers and related data if your MySQL databases belong to a Virtual Server, that may be a bit simpler than the MySQL module and would happen automatically each night (if setup to do so).
Hm. I haven’t actually seen the backup module - where is it located?
When you log into Virtualmin, it’s on the bottom of the nav bar on the left, labeled “Backup and Restore”.
If you don’t see that, my guess is that you don’t have the Virtualmin framed theme installed (which could happen if you installed via a manner other than the nifty install.sh script).
No, i’ve installed virtualmin as an webmin extension. Doesn’t this ext. include the backup module?
Sure, but some features only show up once you have a theme that has links to the appropriate goodies
I might recommend installing a second module, the virtual-server-theme module, which looks much nicer than the stock Webmin theme, and makes a lot of features accessible.
There’s instructions for installing the theme module here:
Look in the "Setting up Virtualmin" section.
Amongst other things, you’ll see an option for working with backups once that’s installed. You’ll be able to select what features to backup (all of them, by default), and you can either do it manually, or you can schedule it to occur, say, once a night. It also supports both full and incremental backups.
Have a good one!
I’ll try that, thanks!