OpenNetAdmin

Track. Automate. Configure.

Home About Features Community Develop
Download this project as a tar.gz file

OLD POST: Re: Backups

Matt

01-09-2009 21:45:19

Here was an old post about doing backups before upgrading.

Hello

Great news, we have a new version. i would like to upgrade, i found the instructions
(http://www.opennetadmin.com/docs/installation), but i need a full backup, to be sure.

Somebody please write a step-by-step instruction about backup and restore.

only thing is mysqldump, or do i need other magic?

Thanks
Gergo




Re: BACKUP
At this point I personally use mysqldump to do my backups. There are of course several ways that one could backup their database but I'll outline a few things that I would suggest.

There are a few basic things you can do.

1. Full database dump of just the table schema and NO data (using root as the example user and ona as the database). This is not super useful to most people:

mysqldump --single-transaction --quick --no-data -u root -p ona

2. Just extract the data itself:

mysqldump --single-transaction --quick --complete-insert --no-create-info -u root -p ona

3. I want everything! This option is good to make a full and complete backup that can restore 100% back to where you started. One thing to note however is that if you have upgraded the ONA code using the install script, it could have performed database schema changes that would not remain if you restore the old schema. Just be aware. This is probably the safest way to go.

mysqldump --single-transaction --quick --complete-insert -u root -p ona


In all these cases you should redirect the output to a file on your hard drive. Bottom line is that the ONA upgrade process does not handle any backups for you. It purely gets you from version A to version B as best it can.

You can restore the data as follows:

mysql -u root -p ona < backup-file.sql


If you did a data only backup and there is data (probably corrupt???) in the database already, it must be removed first as the data only backup does not handle any drop data in it. So you would likely get duplicate data errors if you try and load it over top of existing data.

Hope that helps.

dacosta

03-09-2009 09:43:23

Check out this script. I found it very useful. it will do a daily, weekly and monthly backup of your mysqlDB.

http://sourceforge.net/projects/automysqlbackup/