Large MySQL restore - Tips

Soldato
Joined
13 Jun 2009
Posts
4,240
Location
My own head
Hello all,

Looking to restore one of my sites locally to do some profiling on performance issues that have grown as the site has expanded.

Looking at a 2.5GB MYSQLDUMP, and expanded in situ size of around 3.4GB DB. A few of the tables house a few million rows each. Nothing is relational as it's all active record, and no funky foreign key restraints etc at database level for cascading.

Having major issues running this in locally to my machine, used to do syncs with HeidiSQL and worked fine, but it now seems too large to even perform that activity.

Anyone got experience working with large dumps? What's the quickest way to get them onto my rig? Started playing with Navicat tonight and that is going better with single transactions turned off for server to local sync.

Any tips would be appreciated, net doesn't yield much for this situation!
 
Can't you just import it via the command line directly? I have a 100gb+ database at work and have had no issues restoring it in the past.

Will post the command line if I get a chance at work tomorrow

Did try this before, and left it 24 hours and still was going.

That was with mysql -uroot -p DBNAME < sqlfile.sql

I've looked at my local MYSQL configuration and ensured the innodb pool is decent, so that's at 4GB now with a 1GB log cache (was default XAMPP before which is tiny) - Re-running it at the moment by doing above with the "<" and using SOURCE $FILENAME on MYSQL cli.

Seems to be pushing about 30k rows a second so looks promising.
 
I recently used that exact syntax to restore a 15GB MySQL backup without issue. I don't mean to be patronising, but 3-4GB should be absolutely no problem for a modern computer :)
 
Can't you just import it via the command line directly? I have a 100gb+ database at work and have had no issues restoring it in the past.

Will post the command line if I get a chance at work tomorrow

Apologies never did get round to posting, but just saw this got a bump.

On Windows based servers I always used:

mysql -uroot -p DBNAME -e SourceFile.sql

this avoids any issues with special characters that can get caught up via Windows console / Pipes
 
Back
Top Bottom