1. Home
  2. Getting Started
  3. Moving Your MySQL Database to Pair Networks

Moving Your MySQL Database to Pair Networks

Shared

VPS

Dedicated

There are a few steps you should follow to move one or more of your MySQL databases from an existing web hosting company over to Pair Networks.

1. Create an Empty Database at Pair Networks

You will need to create an empty database on your Pair Networks web hosting account before you can import your MySQL Database. Here are the simple steps to create a database on your Pair Networks web hosting account:

  1. Log into the Account Control Center
  2. Select Database
  3. Select Create New Database
  4. Enter a database name into the Database Name field
  5. Select the access level using the Access Level drop-down menu
  6. Select the optimization period using the Optimization Period drop-down menu
  7. Click Add Database

Take note of the information on the database creation success page. It is recommended that you save the page for future reference.

2. Create a MySQL "Dump File" of Your Database

To move your database from your old web hosting company to Pair Networks, you will have to create what is called a "dump file" of your database. This is basically a copy of your database. Check with your old host on how this would work with their system. Generally, if you log into your hosting you run the following command in a terminal window, you will have created a "dump file."

mysqldump -Qq -hDBSERVER -uUSERNAME -p DATABASE_NAME > backup.sql

Replace "DBSERVER" with the server name where the database currently resides. Replace "USERNAME" with your MySQL username, and replace "DATABASE_NAME" with the full name of the database. With most other web hosting companies, you can leave off the "-hDBSERVER" part, which will make the command default to what is known as the "local host." Many other web hosting companies have databases running on the same server as the web hosting files.

Please also note that when you run this command, you will be prompted for a password. Enter your MySQL database password at this point. Depending on the size of the database, the command may take up to several minutes to run.

The command above will create a file named backup.sql in the current directory where the command was run. Run this command on your old Web hosting or database server. You will then need to upload this backup.sql file to your Pair Networks web hosting account (in your home directory).

3. Upload the Dump File to Your New Web Hosting Account

Use FTP or SFTP to upload the backup.sql file to your Pair Networks web hosting server. After uploading the file, connect to the hosting server using SSH. After you are connected, you can transfer the contents of the backup.sql file into your new empty Pair Networks database by entering the following command in a terminal window:

mysql -hDBSERVER -uUSERNAME -p DATABASE_NAME < backup.sql

Replace "DBSERVER" with your Pair Networks database server name. Replace "USERNAME" with your Pair Networks MySQL username, and replace "DATABASE_NAME" with your new Pair Networks database name. Refer back to the Pair Networks database information page for this information.

Please also note that when you run this command, you will be prompted for a password. Enter your MySQL database password at this point. Depending on the size of the database, the command may take up to several minutes to run.

Updated on February 19, 2020

Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support