BigDump MySQL Importer

Submitted by matthew on Thu, 2008-08-14 22:33

I am not strong with the command line. As such, I rely on PHPMyAdmin to get things done in MySQL quickly. One of the big problems with PHPMyAdmin are the import limitations and timeout issues. In my case, my host's implementation of PHPMyAdmin doesn't even include the import function. In my last post, on upgrading to D6, I described a situation where I really needed to import a database, that I had performed the update on my laptop.

I used PHPMyAdmin to export the database on my live site and plopped it on my desktop. I fired up MAMP and went to MySQL. I created a new database and granted all to a new user on the blank database. I *tried* to import my database--which currently is about 56--and had no joy. I increased the file size and timeout length, but that didn't help me out--I could only get two out of 88 tables to import.

I needed a different solution. In comes BigDump.

BigDump is a script that will take your MySQL database and stagger the import, handling very large MySQL files.

  1. Open up the bigdump.php file with a text editor
  2. Scroll down to the following:
    db_server = 'localhost';
    db_name = 'yourfreshnewdatabase';
    db_username = 'yourfreshnewusername';
    db_password = 'yourfreshnewpassword';
  3. Enter your database name, your database's user name (that you granted all permissions to), enter your user name's password and save
  4. Hop onto your favourite FTP client and FTP onto your server
  5. Place your database sql file and the bigdump php file into the root directory for your web files (typically htdocs or just docs)
  6. Fire up your browser and point it at http://yourdomainname.com/bigdump.php
  7. Follow the directions that pop up
  8. Your MySQL database should import into the empty MySQL database
  9. DELETE the bigdump script from the server. It has your database's username and password in it! I would also delete the MySQL sql database backup file

You should have a restored copy of your database living on your server now. In my case I had uploaded a fresh set of D6 files and modified the settings.php file to look at my new database.

Command line is faster, but if you need an alternate way to import a MySQL database, this is a dandy way of doing it.

Comments

Submitted by KeVroN on Fri, 2008-08-15 00:41

Thanks for the post and as one of my good friends says it, "I am an amazing copy and paste linux hacker!"
I am finally posting after meeting you at DrupalCon. Now that I quit my corp day job and have actually joined the NP space I really like blog. Keep it up.

Submitted by matthew on Fri, 2008-08-15 08:48

Thanks for the feedback. I enjoy writing--and while some of my posts are often hurried--hope that folks find some use in what insights I might have. I have a deep connection to the nonprofit community--through my MFA at Virginia Tech and various jobs I've held. I also can be seen regularly on Tech Soup's Forums where I help moderate the Emerging Technologies board.

If your nonprofit hasn't made use of Techsoup and Compumentor yet, I strongly recommend checking them out.

glqxz9283 sfy39587stf02 mnesdcuix8
sfy39587stf03
sfy39587stf04