Whole Site Database back up and restore

Whole Site Database back up and restore

by David Banach -
Number of replies: 2
I've read on this forum that the best way of backing up an entire site is to back up the whole moodle database and the datafiles. Most of the instructions here have suggested using mysqldump to back up the database and a command line mysql command to restore the backed up .sql file.

If one had access to the servers involved, is there anything wrong with just going into the mysql folder and copying the whole moodle database folder (with all the moodle databse tables in it) and transferring the whole folder into the corresponding mysql folder on the machine to which you are restoring the database, without going through the mysqldump process of making a single file. This seems pretty easy if you have access.

I did this to transfer my moodle site from a windows box to a linux installation and everything showed up and seems to work fine, but before I shut the old windows server down, I want to make sure I'm not missing anything.


Would it be advisable to just setup a cron job to copy the moodledata folder and the actual mysql moodle database folder in order to keep a safe back up of the site, or will it cause problems down the line to not use the mysqldump and restore process?

I've seen quite a few threads here on the whole site backup and restore or site transfer process, so I think clearing up the database backup and restore process would help out us newbies.

Thanks!




Average of ratings: -
In reply to David Banach

Re: Whole Site Database back up and restore

by David Banach -
I was able to find some information on this.

It is, by far, the simplest method of backing up and restoring an entire MYSQL database. The problem is to make sure that all the data is written to hard drive before you make the copy, so locking and flushing the tables, or simply stopping MYsql before you make your back up and then restarting it would be advisable. As a regular backup system it would have the disadvantage of requiring the site to go offline momentarily, but for moving a whole site to a new machine it seems ideal if you have access.

I found these MYsql documentation sites very useful on backup procedures including the newer mysqlhotcopy method:

Learning Journal's  Backing up MYSQL databases tutorial
http://www.desilva.biz/mysql/mysqlbak.html

The MYSQL 5.0  Manual Backup Section and discussion
http://dev.mysql.com/doc/refman/5.0/en/backup.html

If anyone else knows any moodle specific reasons for avoiding rawdata MYSQl backups please let me know.

Thanks

David


In reply to David Banach

Re: Whole Site Database back up and restore

by Mina Rady -
Thanks ... that was very helpful to me