Is it possible to put users mysql sb's in homedir?

11 posts / 0 new
Last post
#1 Mon, 03/16/2009 - 16:03
mnt_schred

Is it possible to put users mysql sb's in homedir?

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.

Tue, 03/17/2009 - 07:14
andreychek

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?
-Eric

Tue, 03/17/2009 - 07:40
mnt_schred

Well, all the user data would be placed in the homedir- making not webmin backups a lot easier- like RSYNC to another server.

Tue, 03/17/2009 - 08:07 (Reply to #3)
andreychek

Howdy,

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:

http://dev.mysql.com/doc/refman/5.1/en/backup.html

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).
-Eric

Tue, 03/17/2009 - 08:10
mnt_schred

That's true- I make db backups through the Mysql module of webmin and that's actually quite nice.

Tue, 03/17/2009 - 08:16 (Reply to #5)
andreychek

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:

http://dev.mysql.com/doc/refman/5.0/en/mysqlhotcopy.html

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).
-Eric

Tue, 03/17/2009 - 08:31
mnt_schred

Hm. I haven't actually seen the backup module - where is it located?

Tue, 03/17/2009 - 09:11 (Reply to #7)
andreychek

Howdy,

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).
-Eric

Tue, 03/17/2009 - 09:43
mnt_schred

No, i've installed virtualmin as an webmin extension. Doesn't this ext. include the backup module?

Tue, 03/17/2009 - 09:54 (Reply to #9)
andreychek

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:

http://webmin.com/vdownload.html

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!
-Eric

Wed, 03/18/2009 - 00:03
mnt_schred

I'll try that, thanks!

Topic locked