How to Migrate Databases into your Reseller Server

In this article, we will show you how to migrate your customers’ databases into your reseller hosting account. At this point, you should have already created a cPanel account. These steps will also work on the VPS reseller program as well as the shared option.

How Do I Know if my Customers are using a Database?

If your customer is using a Content Management System like WordPress or Joomla, or they have a shopping cart, then they are most likely using a database to store the content of their website.

Repairing the Database

It is important to always “repair” the database before exporting. Often, exporting a database without using “repair” can cause data loss due to caching and various server-side functions.

How to Repair a Database in phpMyAdmin

phpMyAdmin is a popular open-source database management system. It is widely used, so your customers may have an available installation in their hosting environment. Here we’ll show you how to access phpMyAdmin from the cPanel interface.

  1. Log into your cPanel.
  2. phpMyAdmin iconClick on phpMyAdmin located under the Databases category.
     
  3. Select databaseSelect the database you want to repair from the menu on the left side.
     
  4. check all tablesUnder the Table section choose Check All.
     
  5. Click repair table in dropdownIn the dropdown menu, select Repair table.
     

How to Repair a Database from the Command Line

If your customer does not have either cPanel or phpMyAdmin, you can also repair the database on the command line using the below command:

mysqlcheck --repair -u [USERNAME] -p [DATABASE]

Make sure to replace [USERNAME] with the actual database username and [DATABASE] with the name of the database.

Exporting the Database

You will need a copy of the database in .sql format. Your customer should be able to provide this to you. If not, there are a few different ways they can export their database.

You can export a database using phpMyAdmin if available. You can also export the database on the command line.

Import the Database into Your Reseller Server

Once you have recovered the .sql file from the old host you can easily import the database into your customer’s phpMyAdmin installation (available through cPanel).

How to Import the Database into phpMyAdmin

The steps below are meant to be followed after you have created a new database to import the original database into.

  1. Log into cPanel.
  2. Go to the Databases section.
phpMyAdmin icon
 
 
  1. Choose phpMyAdmin.
     
choose database
 
  1. Select the database you created to import into.
     
import link
 
  1. Click Import from the top menu.
     
browse computer for zip file
 
  1. Under File to Import click Browse.
     
  2. Locate the database file you are importing.
  3. Gray Go button
     

    Click Go at the bottom.

     

Now that you have imported the database, make sure that any applications that use this database can connect successfully. Remember, you can test the site with a hosts file modification before switching DNS to your reseller server.

If you are working on migrating an account from a non-cPanel host, you can continue to our next article on transferring emails to your reseller account.

CM
Christopher Maiorana Content Writer II

Christopher Maiorana joined the InMotion community team in 2015 and regularly dispenses tips and tricks in the Support Center, Community Q&A, and the InMotion Hosting Blog.

More Articles by Christopher

Was this article helpful? Join the conversation!