15 octobre 2005

Backup a site

Some helps from my experiences on backing up a site.

Backup for the home dir

From the dir that you want to back up
tar cvf - * | gzip > ~/backup-site.tar.gz

Restore it
tar -xvzf backup-site.tar.gz

What is important with this backup is that permissions follow.

Backup database (I used the mysqldump)

mysqldump --user=your_user --password=your_pass --host=source_host --databases database1 database2 etc... | gzip > backupfile.gz

Restore it

gunzip < backupfile | mysql --user=db_user --password=db_password db_name

1 commentaire:

Eugene Heriniaina a dit…

I got a problem when the mysql versions are not the same.

ERROR 1064 at line 19: You have an error in your SQL syntax near 'ENGINE=MyISAM DEFAULT CHARSET=latin1' at line 10