How to Migrate a WordPress Site to a New Domain. In 4 Easy Steps for FREE!

Successful Migration

How to Migrate my WordPress Site to a new Domain extension was something that i have always wanted to find out but investigation always led to expensive software or complicated procedures.  I wanted to migrate to the .COM address but it was not available at the time of setting up my site so I settled on the .NET one instead.

When the .COM eventually become available and the domain capture I placed via my Web Hosting Provider (Heart Internet) snapped up the domain for me and I now own home-mining.com

I can now migrate my WordPress site from .NET to the newly obtained .COM.  My investigation was long and always resulted in expensive plug-in that were going to cost me $$$ so I came up with this solution

https://www.home-mining.net  WordPress Site needs Migrating to https://www.home-mining.com

Sites Before the Migration
Sites Before the Migration

How to Migrate/Backup WordPress from One domain to another?

Firstly, we need to prepare the sites for migration, this involves the following:

  1. Update the source (home-mining.NET) site to latest WordPress version
  2. Delete any unused plugins from source site
  3. Disable any Backup, Security, Firewall or caching plugin on the source site
  4. Install and update the destination (.COM) site to latest WordPress version and use the same admin and password accounts as source site.
  5. Install All-in-One-WP Migration plugin on source and destination sites and activate
  6. Set Both sites to use at least PHP 7.3. This can be done by your hosting provider or on editing the .htaccess file at the root of your site (This works great on my Linux sites)
  7. Add the following to .htaccess

AddHandler application/x-httpd-php73 .php

RLIMITMem Max

All-in-One WP Migration
All-in-One WP Migration

 

How to Export/Backup your WordPress site

  1. On the source site navigate to “All in one WP Migration” Plugin and in the Export Options, choose “Export to a file”, this may take a few minuets
  2. Once The Export is complete it will ask you to download the file to a local drive. Save the file to your local drive, We now have a locally stored file.
  3. When you complete the export, take note of the file size, mine is 527Mb
All-in-One WP Export
All-in-One WP – Export Site to a File
All-in-One WP Migration Download
All-in-One WP Migration Download
All-in-One WP Migration Downloaded file
All-in-One WP Migration Downloaded file

How to Migrate/Import your WordPress site to the new location

  1. Now on the destination site (.COM) navigate too the “All in one WP Migration” Plugin and the Import Option.
  2. Be aware of the “Maximum upload file size: 64 MB.” Message. As my site is around 540Mb we will need to fix this first.

    Max Upload Size 64mb
    Max Upload Size 64mb
  3. We will need to update the php.ini in the root of our site. If you don’t have one then create one using notepad and upload to the root. This can be achieved via a FTP app or a WP plug-in
    Update your php.ini file with 2 new lines
    Update your php.ini file with 2 new lines
    upload_max_filesize = 600M 
    post_max_size = 600M
  4. I will set mine to 600MB to cover the 540MB of my site. We can now refresh the page and the upload size should have changed to 600Mb. If it doesn’t you will need to consult with your hosting provider as they may handle your site setting differently to mine.

    Max Upload Size 600mb
    Max Upload Size 600mb
  5. Click on Import From – File and select the file you downloaded from the source site
  6. DO NOT close your browser at ANY stage during this process

    DO NOT CLOSE
    DO NOT CLOSE
  7. The site will now import, this will take longer than the export, be patient

    Importing Site
    Importing Site
  8. Once the first stage is completed it will ask you to confirm the procedure. Click Proceed

    Confirm the Site Importing
    Confirm the Site Importing
  9. The Restore will continue.

    Restoring - DO NOT CLOSE
    Restoring – DO NOT CLOSE
  10. On completion you should receive the following message

    Successful Migration
    Successful Migration
  11. Refresh your webpage and your site should now load on its new hosting location

    Sites After the Migration
    Sites After the Migration

What to do AFTER you have migrated your site to a new location

After a successful migration we will need to complete a few steps to get the new site back to normal

  1. Set the php.ini file back to original memory settings by removing the 2 lines we previously added in php.ini
  2. On the first login to the new location, you will need to confirm your admin email address again
  3. Reset WordPress Permalinks. Navigate to Settings > Permalinks. And set to “Post name” I believe this is best for SEO purposes
  4. Reactivate your plugin one by one and confirm they still work. Some may need to be deleted and installed again.
  5. Caching, Backup and Security plugin may need a refresh of settings and passwords, cache cleared etc
  6. Install a SSL certificate if you don’t have one on the new domain.
  7. Create a new Admin account, named something unusual and delete the default “admin” account. Default accounts are what hackers try first.

    Always Change Defualt WP Accounts
    97 hacker Attempts on my non-existent Account
  8. Check site for any broken links or hard coded links using the old domain name and fix them.
  9. Submit your new site to Google
  10. Add new Site to Google Analytics

That should now complete the site migration to its new home.  This method can be used to migrate sites from one domain name to another or even from one hosting provider to another. The limits are only that of your imagination