What is BigDump?

NOTE: Moving to the upgrade section, please move to archive if it is duplicated content.

Importing large SQL dumps (when replicating or moving a database) can be difficult for those with only web access to the MySQL server. phpMyAdmin has certain shortcomings when importing files of more than a modest size. BigDump can be a helpful utility in such cases. From the BigDump website:

Staggered import of large and very large MySQL Dumps (like phpMyAdmin 2.x Dumps) even through the web-servers with hard runtime limit and those in safe mode. The script executes only a small part of the huge dump and restarts itself. The next session starts where the last was stopped.

Setting up BigDump

Download BigDump from http://www.ozerov.de/bigdump.php. Once downloaded you need to open the file bigdump.php in any simple text editor (or php editor) to modify the variables required for your server and database.

Commencing at line 39 with "// Database configuration" you need to setup the usual variables to connect to your database (same as are required for Drupal). There is one extra piece of information which the script needs to work well and that is the name of the sql file to be used to setup the database.
Tip: Make sure you upload the file containing the SQL export of your database and bigdump.php to the same directory (root is best) on your webserver.

// Database configuration

$db_server        = "localhost";
$db_name         = "your_DB_name";
$db_username  = "your_DB_user_name";
$db_password   = "your_DB_password";


// Other Settings

// Specify the dump filename to suppress the file selection dialog
$filename             = "the_file_you_wish_to_execute";     

// Lines to be executed per one import session
$linespersession  = 3000;

// You can specify a sleep time in milliseconds after each session
// Works only if JavaScript is activated. Use to reduce server overrun
$delaypersession = 0;      

Save the file once you have set the above (best in the same folder as your sql file backup).

Uploading the sql file and bigdump.php to the webserver

Open your FTP program and open a new session connecting to your webserver root directory and the folder where the sql file and prepared bigdump.php reside on your computer.

Upload both files in ASC11 mode to the webserver root directory.

Running BigDump

Once the files are uploaded you simply need to connect to the bigdump.php script by using the URL
http://www.example.com/bigdump.php

If successfully connected bigdump will greet you with a screen like the below.

BigDump: Staggered MySQL Dump Importer ver. 0.21b
<a>Start Import</a> from "the_file_you_wish_to_execute.sql" into "your_DB_name" at "localhost"

© 2003-2005 Alexey Ozerov - BigDump Home

If it all looks good (i.e.: all the relevant names are correct) then click "Start Import" and the database will be setup by running in short automated stages to prevent server timeouts.

At the completion BigDump will notify you that it is finished.

That's it! You have now copied, moved, migrated, synchronized or duplicated your mySQL database. Well Done!

Thanks go to markus_petrux for the original tip about BigDump

Linux Users

If you are on Linux, just use the source command to read in the SQL file (assuming that you have shell access to the host and assuming that the SQL file has all the instructions you need). If the sql file has only partial instructions, then use input redirection like
mysql mydatabase -h localhost -u [username] -p < ./mydatadump.sql

mysqldumper - a PHP tool similar to phpmyadmin

a great and very easy tool to do backups and restores for big databases is

http://www.mysqldumper.de

its similar to phpmyadmin but it can handle very big databases ( i backup about 1 gb with that tool regularly). it runs on a php-webserver.

Comments

mogop’s picture

How to skip importing 'cache' and 'cache_*' tables ?

asb’s picture

Exclude them from the dump. In Phpmyadmin you can uncheck all unwanted tables, and the 'Backup and Migrate' module has default settings for this.