Import SQL file into new database
You should now have an SQL file, which is your backup database file, safely stored away in your computer. The next step is to transfer the contents of that file into a new database at your new host.
Firstly, access you new host, navigate to the cpanel pages, then to the database section and follow the prompts to create a new MySql database. Obviously, remember the database name and user name for later reference.
Once created, access phpMyAdmin and navigate to your newly created database. In the example that follows I created a new database named, "newdrupaldb". You will notice that there are no tables created as yet, that is what the following process will do. Click on the Import tab and you should see a screen similar to the following. Click on image for a detailed view
At this screen click on the Browse button and a file dialog window should appear. Navigate to the directory where the SQL file resides.

You have a couple of options here. Upon downloading the original SQL file, you might as well compress it, if it wasn't compressed in the downloading procedure. As you can see from the image above the compressed version file size is heaps smaller than the original. The importing process accepts an SQL file either in standard SQL format or compressed (ie. zipped) format. It's quicker to upload a compressed file. Either way select the file to be uploaded. A screen similar to the following should appear with the location of the text file filled in.
Click the Go button to start the uploading process. Depending upon the size of the SQL file, this may take a few minutes, be patient. At the end of the process your screen should be similar to the following.
You should notice that, in the example above, 66 tables were created. Your imported database may have a different number of tables created and that's purely down to the fact that you may be using more or less modules than me.
That's it as far as the database is concerned. When configuring Drupal later on it will be just a matter of modifying the settings.php file with the database details. Trust me, that's a simple process and will be explained when we get to it.
- Printer-friendly version
- Login or register to post comments
- 388 reads





Recent comments
23 hours 38 min ago
1 day 5 hours ago
1 day 15 hours ago
1 day 16 hours ago
3 weeks 6 days ago
3 weeks 6 days ago
4 weeks 29 min ago
10 weeks 1 day ago
11 weeks 4 days ago
11 weeks 6 days ago