Board index Mysql General BACKUP AND RESTORE

how to split a particular database from single database dump

Postby a24uall » Tue Dec 04, 2012 5:11 pm

serve.full-databases.sql is the full database dump file name
aaron_jo151 Is the database name that I want to restore
First find the line number where the database backups start. below command will help you in that :
grep -n "Current Database" serve.full-databases.sql

where serve.full-databases.sql is the name of the full sql dump that we created

In the current example I need a database named "aaron_jo151" restored. So the above command gave me the line numbers as below (Pasting just the relevant part below)
627924:-- Current Database: `aasal_data`
628152:-- Current Database: `aaron_jo151`
631024:-- Current Database: `bafu_jo151`


sed -n '628152,631024p' serve7.all-databases.sql > aaron_newbackup.sql


--
-- Table structure for table `jos_banner`
--



LOCK TABLES `jos_weblinks` WRITE;
/*!40000 ALTER TABLE `jos_weblinks` DISABLE KEYS */;
/*!40000 ALTER TABLE `jos_weblinks` ENABLE KEYS */;
UNLOCK TABLES;
Arun
WebhostingDevelopment.com
a24uall
Site Admin
 
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am

Return to BACKUP AND RESTORE

Who is online

Users browsing this forum: No registered users and 1 guest


cron