Help - Search - Members - Calendar
Full Version: How Do I Restore MySQL data from a Full Site Backup?
The Planet Forums > Control Panels > cPanel/WHM
StealthDesign
How do I restore a MySQL database which was backed up via cPanel's full site backup feature?
Michael
QUOTE
Originally posted by StealthDesign
How do I restore a MySQL database which was backed up via cPanel's full site backup feature?


If you restore the entire site from the backup then cPanel will restore the mysql data automatically.

However, if you just want the MySQL DB restored then untar the backup file and look for a file ending in .sql. That should be all you need. icon_smile.gif If you don't know how to restore from a .sql file then google it or reply and maybe some1 will help you. icon_wink.gif

Michael
WreckRman2
MySQL Backup

mysqldump -u root -p DBNAME > BKPNAME.sql

-----------

MySQL Restore

mysql -u root -p DBNAME < BKPNAME.sql

-----------
solokron
I have a bad sector on a drive that hosed up a customers mysql db.

I have carried over and uncompressed one of the sites backups. Viewing the backup data I was hoping to find a .sql file for the site. Instead there is a mysql directory with the databases in their own folders. Going into the folder of the database I would like to restore I see nothing but .frm, .MYD, .MYI files. How can I restore from this?


Thanks!
solokron
I figured it out.

QUOTE
Originally posted by solokron
I have a bad sector on a drive that hosed up a customers mysql db.

I have carried over and uncompressed one of the sites backups. Viewing the backup data I was hoping to find a .sql file for the site. Instead there is a mysql directory with the databases in their own folders. Going into the folder of the database I would like to restore I see nothing but .frm, .MYD, .MYI files. How can I restore from this?


Thanks!
StealthDesign
QUOTE
Originally posted by solokron
I figured it out.



Can you tell me how? I still don't get it. mad.gif
solokron
Uncompress the backup into a tmp directory.
Within that in the mysql directory locate the db you would like to backup.
copy the contents into its associated directory in /var/lib/mysql/*dbname*

chown -R mysql.mysql /var/lib/mysql/*dbname*


QUOTE
Originally posted by StealthDesign
Can you tell me how?  I still don't get it.  :mad:
StillKlipywitz
didnt work for me.. any more ideas?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.