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.
SUPPORT
Support services for BigDump can provide the solution you need. For more information please contact me.
YOU WANT
To restore the very large backup of your mySQL database (or a part of it) into the new or the same mySQL database. You can't access the server shell and you can't import the dump using phpMyAdmin or any other scripts due to hard memory resp. runtime limit of the web-server.
YOU NEED
USAGE
Note 1: BigDump will fail processing large tables containing extended inserts. An extended insert contains all table entries within one SQL query. BigDump isn't able to split such SQL queries. In most cases BigDump will stop if some query includes to many lines. But if PHP complains that allowed memory size exhausted or MySQL server has gone away your dump probably also contains extended inserts. Please turn off extended inserts when exporting database from phpMyAdmin.
Note 2: Some web-servers disallow script execution in the directory with writing permissions for security reasons. If you changed the permissions on the working directory and you are getting a server error when running the script restore the permissions to their normal state for directories.
Note 3: If Timeout errors still occure you may need to adjust the $linespersession setting in bigdump.php.
Note 4: If mySQL server overrun occures you can use $delaypersession setting to let the script sleep some milliseconds or more before starting next session. This setting will only work if the JavaScript is activated.
Note 5: BigDump is currently not able to restore a single dump file with multiple databases inside (switched by the USE statement).
Note 6: If you experience problems with non-latin characters while using BigDump you have to adjust the $db_connection_char_set configuration variable in bigdump.php to match the encoding of your dump file.
FAQ
Q: I get an error: "MySQL: Bad syntax near DEFAULT CHARACTER SET...". Why?
A: You are probably trying to restore a dump file from a newer mySQL database version into an older mySQL database. Sorry, this is obviously not a very good idea and this can't work. You have to recreate the dump file in compatibility mode or remove all incompatible stuff by hand.
Q: I get an error: "MySQL: Table 'some_tbl_name' already exists". Why?
A: Your dump file doesn't contain DROP queries. Use phpMyAdmin to drop all the tables on the target database which must be restored before you start the import.
Q: I get an error: "Fatal error: Allowed memory size of xxx bytes exhausted" or "MySQL server has gone away". Why?
A: Your dump file probably contains extended inserts. An extended insert contains all table entries within one SQL query. BigDump isn't able to split such SQL queries. Please turn off extended inserts when exporting database from phpMyAdmin.
Q: Why does BigDump fail putting strange SQL errors if I run it from the localhost on my Windows PC?
A: This is IMHO a bug in the PHP 4.3.x that is crashing BigDump on Win32 if using a dump file with DOS encoded line breaks (contact me for details). As workaround create your dump with only the UNIX line breaks or convert it into UNIX format using some text editor. Then you will be able to run BigDump also at your localhost.
Q: Can I use dump files created by other software than phpMyAdmin?
A: You can use any text dump file at your own risk. Although it's very important for BigDump to find a semicolon followed by a line break at the end of each query. It won't work else since it has no time to parse the queries to find their proper ends. Further BigDump behaviour can be unpredictable if your dump file is using double quotes to surround strings. BigDump won't work too if your dump file contains any proprietary comment lines (like in some dumps created by other tools). Although you can use the $comment setting in bigdump.php to drop non-standard comment lines by their first characters. Apart from that BigDump doesn't filter the dump file in any way.
Q: Why don't you provide any facility to input the database configuration from the browser form?
A: Input the database configuration from the form would be very insecure since the settings must be saved in the cookies or returned to your browser everytime the session ends.
