PDA

View Full Version : Restart database restore Operation


decentplayboy
10-07-2017, 02:47 PM
Hi,

i have a large database to restore. around 10gig. there was an interruption in the middle of restoring. how to restart the restore operation from where it stop. I had already waited 5hrs :mad:.. i do not wish to restore the database from the beginning. Can anyone here please help to share the syntax to use in ssh? Thanks

Dave
10-07-2017, 03:51 PM
Unless you generated the database backup with the "IGNORE" option, there's no way to just let it skip half of the dump.

You got 3 options:
1. Delete the half restored database and start over.
2. Open the dump file and remove everything that has already been imported. Bit unpractical since it's hard to work with files of multiple gigs.
3. Look at where your database import stopped in something like PHPMyAdmin, then delete the most recent table that was imported (it always imports from A to Z, so delete the table that's at the bottom of the list) and re-export the database to include all the tables that are still missing.

Personally I would go for option 3.

decentplayboy
10-07-2017, 08:53 PM
Unless you generated the database backup with the "IGNORE" option, there's no way to just let it skip half of the dump.

You got 3 options:
1. Delete the half restored database and start over.
2. Open the dump file and remove everything that has already been imported. Bit unpractical since it's hard to work with files of multiple gigs.
3. Look at where your database import stopped in something like PHPMyAdmin, then delete the most recent table that was imported (it always imports from A to Z, so delete the table that's at the bottom of the list) and re-export the database to include all the tables that are still missing.

Personally I would go for option 3.

Thanks dave. Option 3 is not possible as my existing database is corrupted. I have only the backup from mysqldump. I think i have no choice but only option 1. Btw, do you know any command to put in restore syntax to avoid interruption? I found that previous view time stop half way were due to connection lost

--------------- Added 1507421424 at 1507421424 ---------------

Is there a way to create a new sqldump file which exclude few table from my old sqldump file? If yes, what is the syntax to use? Thanks

Dave
10-07-2017, 10:20 PM
Refer to https://unix.stackexchange.com/questions/218125/using-nohup-to-import-mysql-dump-on-debian-server to run it as a background task.

As for your second question, do you mean you want to make a new dump based on the current dump file you have? I'm not aware of any easy way to do that.

decentplayboy
10-07-2017, 11:47 PM
Refer to https://unix.stackexchange.com/questions/218125/using-nohup-to-import-mysql-dump-on-debian-server to run it as a background task.

As for your second question, do you mean you want to make a new dump based on the current dump file you have? I'm not aware of any easy way to do that.

thanks alot bro