[How To] Migrate Your Wordpress Site! (JULY 2020)

The Most Fearful moment for a developer — SITE MIGRATION.

As the saying goes, do not fix something that is not spoiled, so whenever migrating a site from a TEST server, to the LIVE server, you will ask yourself what will happened, what will cracks when the migration is over!

BELOW are the steps you can take while migrating your WORDPRESS site, and also fixing the common things that needed to be fix.

ALL THE BEST, I AM PRAYING FOR YOU

  1. Back up your website files
  2. Export the WORDPRESS Database
  3. Setup the WORDPRESS Database on your new server
  4. Upload The WORDPRESS Files to your new server
  5. Edit the wp-config.php File
  6. Import Your WORDPRESS Database
  7. Replace the New Domain with the Old Domain
  8. Clean up the (Missing Images and Files)

When you are ready! Let GO!

STEP 1 — Backup your website files

The first step of all migration is to backup everything on your website.

This is the first and foremost step in your migration plan, so normally there are available WORDPRESS plugins that can be downloaded and used, these plugin is great for you to backup your files and various versioning, TODAY i am explaining how to backup your WORDPRESS website manually!

Manual Backups — means you will need to have the CPANEL access, an FTP account, and to understand your file manager. Backing up your WORDPRESS website which includes every single files in your website. The backup might takes a few hours base on the numbers of files AKA media that you had uploaded.

Step 2 — Export the WORDPRESS Database

Exporting your DB is alot more simple process. First Login to your CPANEL, go to phpMyAdmin application, select the Wordpress DB that belongs to your website. (to find out which DB — go to wp-config.php file, and look for the DB that was mentioned in the file) Once selected, click on the Export Tab on the right side of the naviation menu.

Leave the setting as default — Quick Export and the format to be SQL. then click on the “GO” button to extract the file to your desktop.

Step 3 — Setup the WORDPRESS Database on your new server

Creating the new DB on your new server.

  • Open MySQL Database, create a new database with a name that you can remember for your website (Usually I will name it [something]-wpdb)
  • Create a MySQL user with a secure password that you can remember
  • Link up the DB wit User and grant him All Priviledges

Write down the DB name, MySQL username and password, you will need it in the next step.

Step 4 — Upload The WORDPRESS Files to your new server

Go to your new Server — upload the while Zip file and unzipped it in the public_html folder. DO NOT remove the zip file till you are done with the whole migration.

Step 5 — Edit the wp-config.php File

Go to the file named: wp-config.php, click on the editor function in your file manager and update the following codes.

  1. Define the DB name
define('DB_NAME', 'db_name');

2. Set DB user

define('DB_USER', 'db_user');

3. Set DB user password

define('DB_PASSWORD', 'db_password');

Save wp-config.php and close the file.

Step 6 — Import Your WORDPRESS Database

Now this step is going to be jsut uploading your DBscript which you just exported back to the new DB in your new Server.

Go to your phpMyAdmin in the CPANEL, select the new DB, and click on the Import tab from the menu on your right side.

Select the DB file that you had just exported, and click ok.

Select format: SQL and click on the “GO” button to proceed.

LEAVE your comments below if you meet any problem. I will help you from there.

Step 7 — Replace the New Domain with the Old Domain

Once all the earlier steps are completed, now we are talking about the real deal.

Assuming that nothing else breaks “PRAY”. We will need to get the URL fixed

Get the URL working if the previous site and current one are different (Testing server to Live)

  1. Go to phpMyAdmin, Select the DB
  2. Open up the DB extension and look for wp-options
  3. Click on the small icon indicated as Browse.
  4. Under the field option_name, scroll down and look for siteurl and home
  5. Change both fields to the New URL

When this is completed, you basically had your migration done, you can now go to your new Website URL and see if the site is working fine.

Step 8 — Clean up the (Missing Images and Files)

This is an additional steps to make sure all the images are safely migrated.

  1. Go to phpMyAdmin, Select the DB
  2. Open up the DB extension and look for wp_posts
  3. Select SQL
  4. Enter these codes
UPDATE wp_posts SET post_content=(REPLACE (post_content, 'testing.domain.com', 'domain.com'));

Leave your comments if you have any question regarding the migration! I will love to help!

CATCH YOU SOON :)

--

--

Digitization Coach | Adrian Soon
Digital Marketing Buzz

I trained business owners how to digitise their businesses, and achieve great result in digital marketing.