In Part I of this series, I showed you how to transfer your files and folders from your older cPanel account to NameHero. But modern Content Management Systems (CMSs) are far more than mere files. The “meat” of your site is in the database. To upload your website in cPanel, we need to move the database as well. All the content, settings, widgets, and menus reside there. Recent themes and versions of WordPress have moved even more functionality into the database. Plugins for example, use databases to store their settings and data.
So Part II of this series focuses on transferring the “engine” of your site to NameHero. Let’s get started!
Step 1: Get the Name of Your Existing Database
To export your database from cPanel, you need to find out what the name of your current database is. If you’re using WordPress, open the root of your website and look for the “wp-config.php” file. This file contains all the essential connection details for WordPress, including the database name as shown here:
Step 2: Locate the Database in phpMyAdmin
cPanel has a fantastic web based tool using which you can access and manipulate your databases. To do this, log into cPanel and search for the phpMyAdmin icon like this:
This will log you into all the databases connected with your account. On the left-hand side, find the database name that you got in Step 1 and click on it:
Now we’re going to export this via a file.
Step 3: Export the Named Database
Once the database on the left is selected, see the tabs on top and click on Export:
The default settings are fine. Click the “Go” button at the bottom. This will initiate a download of your database to the desktop in the form of a text file. Depending on the size of your database, it may take a few minutes. A medium sized size can have a database size of say 30 MB.
Step 4: Creating the New Database on NameHero
Before importing our data, we first need to explicitly create a new database on cPanel. The reason is that we might not have permissions to create a new one from directly within phpMyAdmin.
So first log into NameHero’s cPanel and click “MySQL Databases” as shown here:
This will bring up the database creation dialogue box right at the top.
As you can see, it’s divided into two sections and the first one is selected automatically for you. This is done for security reasons to ensure that all databases don’t have easily guessable names. Enter a suffix for the new database. It could be anything – or you might choose to use the suffix of the old name. Click “Create Database” and you’re done!
Step 5: Importing the New Database SQL File
Go back to your cPanel log in screen and scroll down to find the phpMyAdmin icon in the NameHero control panel:
Like before, this will log you into your database section and you should now see the new database you created in Step 4 on the left-hand side. Click to select it.
Now go to the tab labeled “Import”. Here, you will see the button “Choose File”. Click it, and select the SQL file you downloaded in Step 3.
Once you’re done, click “Go”. This will initiate the import of the file and if all goes well, you should see a “Success” screen afterward like the one here:
Step 6: Using the New Database in WordPress or Wherever
Finally, you need to ensure that your new installation of WordPress is updated with the database name. As in Step 1, navigate to your site’s wp-config.php (on NameHero this time instead of the older cPanel). And as in that screenshot, replace whatever database name was there with your new one – remember prefix and suffix!
For other CMSs, you’ll need to follow different instructions.
Congratulations! You’ve successfully imported your database into NameHero along with the files and folders as shown in Part I of this tutorial. This completes the transfer of your site.