How to Move a WordPress Database to a New Server or Hosting

The WordPress database is where your blog data and information are being stored. Without that database, WordPress is jut a software that can’t work, as it’s a mix between MySQL and PHP. But, when beginners wants to move to a new hosting server, they find themselves lost in lots of details, and things to do, in order to migrate their sites easily.

Luckily, there is no problem at all if you follow this step by step tutorial, you will find how to move a WordPress database to your new server. What you need is 5 minutes, and the database will be moved using one of the below main methods.

You can read also: How to repair all WordPress tables in MySQL database using PhpMyAdmin.

How to move a WordPress database using cPanel

This is the easiest way to migrate any MySQL database. It lets you move any WordPress site to a new server without problems. All you have to do is login to your cPanel account first, then locate the icon called “Backups” in the files tab, as the following screenshot.

how to Move WordPress Database to New Server

Now, you will get the next page, and you have to select the database that you want to download to your computer. Next, upload it to the new hosting server, forget the first part of the page that says “Full Backup”, and focus only, on the next part that says”Partial Backups”.

If you have one single website, you will find a single database name, as the following example, and you need to click on it in order to start the download.

How to Download Database from cPanel

The database file will be automatically downloaded to your computer, just remember its location.

Now, that we have learned how to download the database from the cPanel, you need to restore it on the new server. It will be added automatically to the new WordPress installation, without doing anything.

How to restore a WordPress database in cPanel

I’ll show you two ways to move a MySQL database to a new server. The first one works only when you have the same WordPress installation, and all the files as the old server and the hosting provider. In other words, this is only valid, when you moved all your blog from another server.

To restore your WordPress database, login the new cPanel account, and click the same icon that you’ve used above, it’s the “Backups” and in the same page as the above example. You just need to focus on the right part of the page, where you see the “Upload” buttons.

You have a MySQL database to restore. So, use the “Restore a MySQL Database” area, and click “Upload” as this screenshot example.

How to Restore a Database in cPanel

After uploading the database, you will see a page with slots of information, and that’s the successful restoring.

The second way to restore the WordPress database works for both, the new and the old installations. You will replace all the actual installation database tables, with the old one in a few clicks. First, come back to the cPanel and find an icon called ”phpMyAdmin” in the “Databases” tab, and click on it.

restore Database in phpMyAdmin

In the next step, you will get the phpMyAdmin interface, and you need to click the name of your new database that was created with the new installation (or the old installation, as well). The database name is located on the top left area of the page as below, and you need to click the “import” option, at the top of the page.

import database in phpMyAdmin

Choose the file from your computer, and then, scroll down in the above page example, and click the “Go” button. Wait until the database successfully uploaded and that takes a few minutes, especially, if you have a large database.

Then it’s done, you don’t have to edit any file, or doing anything else, because the database was imported in the actual database. So, it will save the same name, but it replaces the new tables with the old ones. Thus, you have a new blog or website in a new server, but with the old database and files.

How to migrate WordPress database using phpMyAdmin

This is another method to move your MySQL database from the phpMyAdmin dashboard, and it’s needed when you have issues with the above methods. As the above example, login to cPanel and click the “phpMyAdmin” icon. Then, select the database that you want to copy, and download, click “Export” link at the top of the page.

export a database in WordPress

Next, you will get the file that’s not compressed this time, and you need to save it locally. The next step will be uploading this database to the new hosting server. You need to login to the same phpMyAdmin account. Next, select the new database name, and you will get all the tables.

Then, you can just click the “import” database option, at the top, and select the downloaded file from your computer, and it’s done.

Please remember, you can upload only compressed files that are in gzip, bzip2 or zip format, and all the above downloading method, will result a supported format, so, don’t worry about that.

That’s it, your WordPress database was just moved to the new server, and you can login to your blog and start working properly.

Share This