Skip to content

Migrate your WordPress website – How to set up migration – MySQL database & wp-config.php

Reading Time: 5 minutes
Migrating WP website

Hey there, hope you’re well and not stressed out, I remember how confused I was when I had to migrate a WordPress website for the first time. Don’t worry, it is really simple. In this article you will learn step by step how to migrate your WordPress website – How to set up – MySQL database & wp-config.php.

If you’re looking for the fastest and cheapest WordPress hosting, get 10Web RN.

If you’re looking for ready made website, visit here.

Here’s the content table

  1. Intro
  2. Components
  3. Preparations
  4. Installation
  5. Possible issues

1. Install WordPress on your domain

In case you’re not migrating but just installing, then you can skip the below steps and jump directly here.

Here’s the bigger picture of the process.

  1. Your website has 2 components, database and the actual website files (codes, images, everything).
  2. We need to move these 2 from the old hosting/domain to the new one.

Migrating WordPress website:

  1. Compress & download your current website
  2. Export your current MySQL database
  3. Import your database to the new hosting
  4. Upload your website to the new hosting
  5. Configurations

Installing WordPress on your website:

  1. Download .zip WordPress file from here
  2. Upload WordPress
  3. Create database, a user, add the database to the user. Make sure to save the password
  4. Run {your_domain}/wp-activate.php
  5. Follow the steps, done

2. Required components in the migration process:

  1. WordPress website .zip format
  2. Database
  3. Database user
  4. cPanel or FTP (in this example I’ll show it on cpanel, the same can be done with FTP)

3. Export and download your current website files: The organized way of preparing the migration

Compress WordPress website

Go to cPanel -> Files manager -> public_html -> find your website’s current location -> Click on the folder -> Click compress -> Choose Zip Archive (rename if necessary) -> Compress files.

After refreshing the page you will find the new zipped file, click it and download it.

MySQL Database export

If you don’t know the name of your data base, firstly, go to cPanel -> Files Manager -> public_html -> find your website’s location -> find the wp-config.php file in the root directory of your website’s wordpress folder -> Click it and click on the edit button -> You will find the name & username of your database.

Now that you know the names:

Go to cPanel -> phpMyAdmin -> Find your database, click it -> Click on export from the top menu -> Go

So now you have two files, your WordPress website zipped and your database. Remember it is crucial to have both 😀

4. Installing WordPress website on your (new) hosting

Being organized is the key to not facing issues afterwards.

Here are the general steps:

  1. Create new database
  2. Create new user to the database
  3. Add the user to the database
  4. Import the database
  5. Configure database options
  6. Upload your WordPress website
  7. Make the necessary changes to the wp-config.php
  8. Either Go or re-check everything

Note 1: If you’re using the same cPanel then directly jump to step 5.

2: If you’re migrating to another cPanel, then all the steps below are only on the NEW cPanel.

3: In the steps below, I’m assuming you’ve added your domain to the hosting, or is the main domain of the hosting, so either way, I’m assuming you know where domain directory in the file manager.

1. Create new database

Go to the new cPanel ->  MySQL® Databases -> enter your database name -> Create Database

2. Create new user

Go to the new cPanel ->  MySQL® Databases -> scroll down to the “MySQL Users” section -> “Add New User” -> enter the name of the database -> enter the password or generate one (copy the password somewhere to save it) -> Create User

3. Add the user to the database

Go to the new cPanel ->  MySQL® Databases -> scroll down to the “Add User To Database” section -> choose the new user, the one you just created -> choose the new database, the one we just created -> Add -> check the ALL PRIVILAGES box -> Make Changes

4. Import the database

Go to the new cPanel -> phpMyAdmin -> select the new database -> click on import from top menu -> Choose File -> select the database you downloaded from the old cPanel -> Go

5. Configure database options

Firstly, go to the new cPanel -> phpMyAdmin -> select your database -> from the left menu options find and select wp_options -> you can see your old URL in the first two values of the option_value -> replace both of the URLs with your new URL

6. Upload your WordPress website

Firstly, go to the new cPanel -> File Manager -> public_html -> locate the your new domain’s folder -> Click on upload from the top menu -> Select File -> choose the .zip file that you downloaded from the old hosting -> wait for the upload to finish -> go back to file manager and the folder -> find the zip file you just uploaded, click on it and choose Extract from the top menu -> enter the extracted folder, select all the files and move them one level up.

7. Make the necessary changes to the wp-config.php

Enter the newly added and extracted folder -> find wp-config.php -> click it and choose edit from the top menu -> change the database name, user and password (the password that you copied during database user creation step – step 2).

( ‘DB_NAME’, ‘new_database_name’ );

( ‘DB_USER’, new_database_user’ );

( ‘DB_PASSWORD’, ‘the password you copied’ );

Your website should be working just fine on the new domain/hosting

5. Possible issues you might face after migrating your website

Data base not being uploaded

The issue is usually the file size, your database size could be larger than the allowed file upload size. You have two solutions.

  1. Compress your database, make sure the extension is .sql.zip then try uploading it. This should fix the issue.
  2. Change the max upload file size from cpanel.

Payments not working on the new website

If you’re using a custom payment gateway, it is best to contact your payment gateway’s support. Some common issues.

  1. Whitelist new hosting’s IPs
  2. Payment gateway’s configurations for the new URL
  3. Check the error log file, this could be a headache if you’re new to it. You can just download the log and send it to the payment gateway’s support.

New website not working

If your old website is a bit complex, and has been through a lot, it might not work, and the reason would be so tough to identify, you would need an expert to work on it.

Conclusion

Migrating/installing a WordPress website is really simple, therefore, just be organized and try to understand the bigger picture.

Leave a Reply

Subscribe, I never spam

Agapi
stepanyanagapi229
Read More
Although I don’t have a restaurant the urge to read it was too strong and didn’t disappoint. I guess if you have a restaurant this is a must-read. Thanks a lot.
Diogo Barros
Diogo Barros
Read More
Thank you !
J
J
Read More
i've been searching everywhere for this solution, you're the first person who gave a simple solution. Ty
Farah I
Farah I
Read More
Thanks. I already have cloudflare and its still slow.. was thinking of how to remove unused js... but found your video instead
BLACK ANT
BLACK ANT
Read More
makes complete sense bro. Thank you
 Tobee Panyasith
Tobee Panyasith
Read More
Thank you for this great video

Table of Content

Subscribe to my mailing list

I never spam