« How Do I Transfer A Website? - Part 1 | Home | Transferring Databases - How Do I Transfer A Website? - Part 3 »
Transferring Databases - How Do I Transfer A Website? - Part 2
By Max | June 10, 2007
Most websites these days come equipped with a few databases to run whatever software might be powering the site. All wordpress blogs use databases, most forum software uses a database, and so do plenty of other apps. In my opinion database usage has gotten a little out of hand. You’ll find even the smallest applications are running databases.
Transferring a database from the previous server to your new server can be complicated. For smallish databases, my preferred method is using phpMyAdmin through the cpanel interface that runs on many webservers. PhpMyAdmin has an import and export function that makes database transfer as painless as possible.
First you need to export:
Once you have opened phpmyadmin, select the DB you want to export from the drop down menu. Then click the “Export” tab.

Next, on the Export screen, select the following
“Select All” - for the tables to be exported
“SQL” - Type of file
“Structure”
“Add AUTO_INCREMENT value”
“Enclose table and field names with backquotes”
“Data”
“Use hexadecimal for binary fields”
Export type = INSERT
“Save as file” and whether or not you want it zipped

Click OK to save, and downloading should proceed.
To import this DB to the new server, you first have to create a DB, and then add a user to it. This can be done through cpanel. Then you should open up phpMyAdmin on the new server and select the newly created DB from the drop down menu.
Click the “Import” tab from the menu. Then select the file that you just downloaded in the exporting step above. This part is a little hokey because if the file is too large, your browser will time out before the uploading is finished. phpMyAdmin tries to adjust for that, but I recommend using a different method for really large DBs.

This method works well for small DBs, but for large ones, we’ll need to use the command line interface for mysql. Tune in tomorrow for details on that.
Topics: Article |
June 10th, 2007 at 1:34 pm
Good stuff. Maybe you should put this series together in a PDF for dowload on your site. An ebook might also be a good idea.
June 10th, 2007 at 2:33 pm
This is a really useful series you are publishing - I agree with Joey; you don’t want this stuff ending up buried in your archives!
- Martin Reed
June 10th, 2007 at 6:00 pm
I’ll add it to the Getting Started Buying Websites page.
I just write this stuff as it comes to me. Once I get a big enough collection of articles, I’ll try to put it all together in an ebook for you guys. For now, if you have specific questions let me know. It makes it easier for me if I don’t have to guess about what people might need to know.
Also the “Articles” category is where I try to put posts that will be as relevant in the future as they are today.
June 10th, 2007 at 6:26 pm
[…] Transferring Databases - How Do I Transfer A Website? - Part 2 | […]
July 4th, 2007 at 1:53 am
[…] will still have to transfer the DBs by exporting them as I mentioned […]