Exporting your Database for Transfer

Note: that you will require root access in order to follow these directions.

A very common task that’s often involved in moving from one host to another is the migration of databases. There are two ways to export your database if you’re using MySQL – through a client interface like phpMyAdmin or through the command line using SSH. We’ll cover both methods in the steps below.

Exporting a Database with phpMyAdmin

    1. Login to WHM as the “root” user.
    2. Open phpMyAdmin. In WHM you can easily search by typing “phpmyadmin” in the search bar at the top left, and you’ll see it appear in the menu.
       
    3. Click on the button labeled Databases.
    4. Select the Database you want to export.
       
    5. Click on the tab labeled EXPORT.
    6. We will be using the QUICK options and exporting in the SQL format. This means that you don’t need to select any options. Just click GO in order to begin the export of the database. You will be required to select a location to save the file and name the saved file. Make sure you record this location as well as the name of the file so that you can find it later.
       
For more information on phpMyAdmin, please see the official documentation

.

Exporting a Database using the MySQL Command Line

  1. Login to SSH as the “root” user.
  2. Use the following command line:

    mysqldump -u username -p databasename > SQLfile-created-by-export.sql

    The table below breaks down the commands:

    UsernameThis is the MySQL user assigned to the database
    DatabasenameThis is the name of the MySQL database
    SQLfile-created-by-export.sqlThis is the name of the SQL file created when the file is created

    Keep in mind that the location of your exported file will be based on where you specify the file location in the command, or, if you don’t specify the location, based on where you actually run the command. Make sure that you record the location name of the file so that you can find it later.

Congratulations, now you know how to export databases from PHPmyAdminm and command line interface!

Need terabytes (TBs) of space for your web hosting needs? Check out our Dedicated Server Hosting.

AC
Arnel Custodio Content Writer I

As a writer for InMotion Hosting, Arnel has always aimed to share helpful information and provide knowledge that will help solve problems and aid in achieving goals. He's also been active with WordPress local community groups and events since 2004.

More Articles by Arnel

Comments

It looks like this article doesn't have any comments yet - you can be the first. If you have any comments or questions, start the conversation!

Was this article helpful? Let us know!