Home‎ > ‎unix/linux‎ > ‎Centos Systems‎ > ‎gallery‎ > ‎

Backup and Restore


You are going to need to copy or save all the photos somehow.  One way to do this is simply taring up all of the files, the other is to use something a bit fancier, like rsnapshot.  If your just copying the files from one server to the other, use rsync.  

Either way, you need to grab the pictures from the system you want to back them up from, and then put them on the server you want to recover to.  


backup the database: 
mysqldump --add-drop-table -h localhost -u root -p gallery2 (tablename tablename tablename) | bzip2 -c > g2.bak.sql.bz2
so for example: 
mysqldump --add-drop-table -h localhost -u root -p gallery2  | bzip2 -c > g2.bak.sql.bz2

restore the database: 
mysql -u [uname] -p[pass] [db_to_restore] < [backupfile.sql]
So, for example: 
mysql -u root -p gallery2 < g2.bak.sql