LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-15-2007, 11:38 AM   #1
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 546

Rep: Reputation: 30
Smile restore mysql backup


I'm backing up a joomla site .Because it's the first time i do this what's the general procedure i have follow to restore the site on an another host,still debian.I'm backing up by a really nice script which is a mix of rsync , ssh , mysqldump and few more unix commands.
I have backups sorted by date from when the backup started up to current.My doubt is:it is an incremental backup so where is going to be the complete list of files?Do i have the overwrite all the directories in the backup folder ?
Quote:
2006-12-08_18:00 2006-12-19_06:00 2006-12-25_00:00 2006-12-30_18:00 2007-01-05_12:00 2007-01-11_06:00
2006-12-09_00:00 2006-12-19_12:00 2006-12-25_06:00 2006-12-31_00:00 2007-01-05_18:00 2007-01-11_12:00
2006-12-09_06:00 2006-12-19_18:00 2006-12-25_12:00 2006-12-31_06:00 2007-01-06_00:00 2007-01-11_18:00
2006-12-09_12:00 2006-12-20_00:00 2006-12-25_18:00 2006-12-31_12:00 2007-01-06_06:00 2007-01-12_00:00
2006-12-09_18:00 2006-12-20_06:00 2006-12-26_00:00 2006-12-31_18:00 2007-01-06_12:00 2007-01-12_12:00
2006-12-10_00:00 2006-12-20_12:00 2006-12-26_06:00 2007-01-01_00:00 2007-01-06_18:00 2007-01-12_18:00
2006-12-10_06:00 2006-12-20_18:00 2006-12-26_12:00 2007-01-01_06:00 2007-01-07_00:00 2007-01-13_00:00
2006-12-10_12:00 2006-12-21_00:00 2006-12-26_18:00 2007-01-01_12:00 2007-01-07_06:00 2007-01-13_06:00
2006-12-10_18:00 2006-12-21_06:00 2006-12-27_00:00 2007-01-01_18:00 2007-01-07_12:00 2007-01-13_12:00
2006-12-11_00:00 2006-12-21_12:00 2006-12-27_06:00 2007-01-02_00:00 2007-01-07_18:00 2007-01-13_18:00
2006-12-11_06:00 2006-12-21_18:00 2006-12-27_12:00 2007-01-02_06:00 2007-01-08_00:00 2007-01-14_00:00
2006-12-11_12:00 2006-12-22_00:00 2006-12-27_18:00 2007-01-02_12:00 2007-01-08_06:00 2007-01-14_06:00
2006-12-11_18:00 2006-12-22_06:00 2006-12-28_00:00 2007-01-02_18:00 2007-01-08_12:00 2007-01-14_12:00
2006-12-12_00:00 2006-12-22_12:00 2006-12-28_06:00 2007-01-03_00:00 2007-01-08_18:00 2007-01-14_18:00
2006-12-12_06:00 2006-12-22_18:00 2006-12-28_12:00 2007-01-03_06:00 2007-01-09_00:00 2007-01-15_00:00
2006-12-12_12:00 2006-12-23_00:00 2006-12-28_18:00 2007-01-03_12:00 2007-01-09_06:00 2007-01-15_06:00
2006-12-12_18:00 2006-12-23_06:00 2006-12-29_00:00 2007-01-03_18:00 2007-01-09_12:00 2007-01-15_12:00
2006-12-14_00:00 2006-12-23_12:00 2006-12-29_06:00 2007-01-04_00:00 2007-01-09_18:00 current
2006-12-16_00:50 2006-12-23_18:00 2006-12-29_12:00 2007-01-04_06:00 2007-01-10_00:00
2006-12-18_11:38 2006-12-24_00:00 2006-12-29_18:00 2007-01-04_12:00 2007-01-10_06:00
2006-12-18_12:00 2006-12-24_06:00 2006-12-30_00:00 2007-01-04_18:00 2007-01-10_12:00
2006-12-18_18:00 2006-12-24_12:00 2006-12-30_06:00 2007-01-05_00:00 2007-01-10_18:00
2006-12-19_00:00 2006-12-24_18:00 2006-12-30_12:00 2007-01-05_06:00 2007-01-11_00:00
From the command line how do i backup the database ?Which one is the complete one? sorry for the silly question but i can't afford to loose all he work on this site.thanks !
Quote:
root@www:~# ls /backup/current/
etc initrd.img.old mysql_backup swap var vmlinuz vmlinuz.old
root@www:~# ls /backup/current/mysql_backup/
Database.sql cilento.sql gabrix_mail_provider.sql mysql.sql snort.sql test.sql tor-final.sql tor-onion.sql
 
Old 01-15-2007, 12:20 PM   #2
osdeals
Member
 
Registered: Jul 2006
Distribution: RHEL, CentOS, PuppyLinux, SuSe, Ubuntu, Debian
Posts: 59

Rep: Reputation: 15
Whoa! That's a pretty good collection of backups, but pretty much useless if you can't figure out which one to use.

You'll need to figure out which one contains your last FULL backup, restore that first using
mysql -u username (-h hostname) -p your_joomla_database_name < fullbackup.sql
Use the -h hostname only if you're connecting to a different mysql server from the machne where you execute this..

After you've done that, you'll need to restore each incremental in the same order in which they were taken.

Alternately, just take a fresh full backup with
mysqldump -u username (-h hostname) -p your_joomla_database_name > fullbackup.sql
and simply restore it with the command above.
 
Old 01-15-2007, 12:53 PM   #3
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,159

Rep: Reputation: 258Reputation: 258Reputation: 258
Hi

Just wanna give another tip I learned from somoneone. If you have those files, and the server completely dies, it will probably take you a little while just to get another Debian server up with all the packages that you use.

In the backup script, add the line, e.g.
dpkg --get-selections >/etc/debian.packages.txt

The file "debian.packages.txt" now has a list of all packages on the system. If you need to set up a new server, set it up with just a base system, then do a:
dpkg --set-selections </etc/debian.packages.txt

Then start e.g. dselect, select install and you have the same stuff installed. I think this could be more useful than a backup of the kernel.

Last edited by Guttorm; 01-15-2007 at 12:54 PM.
 
Old 01-15-2007, 01:57 PM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Hate to burst your bubble but mysqldump doesn't do incremental backups, just full dumps, unless you've got some nifty script that is picking up just the changes from the binary logs that you had to enable in order to get incremental type backups running. If not, then you're latest dump would be the backup you'd want to reinsert into the new host mysql server, or depending on the size, disable your site and take a snapshot now to transfer over and bring the site up on it's new host.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot restore backup jon23d Linux - General 2 11-02-2006 06:24 PM
Backup Restore to new PC tjabaut Linux - Hardware 2 07-15-2006 12:01 AM
restore backup nkeever Linux - Newbie 2 06-19-2006 10:03 AM
backup / restore 5pints Linux - Software 2 01-11-2005 10:08 AM
RH 7.3 Backup and Restore MrJoshua Linux - General 1 06-18-2003 12:39 PM


All times are GMT -5. The time now is 05:18 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration