Migrating a WordPress Website to a New Domain – The Easy Way

I recently migrated this website you are visiting from the old address to this web address with few simple steps. This blog post is a simple log, a walk-through of what I did for migrating a WordPress website to a new domain and how I did it.

My previous domain name was blog.lakshmanbasnet.com (yeah a subdomain) and the current migrated domain is lakshmanbasnet.com. Even though I migrated from a subdomain to a root domain, these processes are almost similar for every other migration.

Background

Reason for migrating

I started learning how to write blogs from 2014 with WordPress, shifted to Jekyll for writing later and again reverted back to WordPress in 2020. All this time till 2021 June, I was publishing my blogs from a subdomain – blog.lakshmanbasnet.com. I just liked this subdomain, never had any problems.

This blog had started to receive a good number of organic visits while the root domain barely had more than ten organic visitors in a day. I tried applying for Google Adsense to show ads on blog.lakshmanbasnet.com but as we know that Google primarily looks for root domain before accepting subdomain it was harder to get accepted. And because of this I just wanted to shift my whole blog to the root domain and give it a try. I knew it was going to be a long journey but I couldn’t control myself from trying and here we go!

Tech specs

Before I write the steps, let me share about the technical environment this website run on. This website is a WordPress blog being hosted on DigitalOcean’s VPS and being managed with Plesk, for DNS management I am using Cloudflare’s free plan.

Get $100 Credit on DigitalOcean.  Join Now!

Following image will give you how it was like before migrating and merging the sites.

wordpress website migration

Getting ready

Before starting the whole process it was important to make sure I was doing the right things – the right way.
I made a small plan, noted down what to do first, then what second and so on. I also made a backup plan, a secondary plan to work out if something goes wrong while moving the live website to a new domain.
As both of my sites were just an informative blog and static site involving no real-time payment processings or similar it was easier for me to migrate real-time.

Migrating the website

Website migration 101 – Backups

Every tutorial you look after novice to advanced will suggest starting with Backing Up your project and files before starting to make any changes. Migrating a website is a very sensitive and highly cautious job to do. So saving the whole website’s file and settings is vital to restore in case something goes wrong. Instead of losing all the files and worrying about what to do just a simple restore from backup will save our time.

In my case, I had enabled the weekly droplet backup with DigitalOcean. So in case, I need to restore the previous stage of my website I could easily restore from previous backups.

Once the backup is ready, it is time to move the website files to new domain.

Moving website to a new domain with Plesk

A website and its files can be moved from its current hosting server to a new one by different methods. Depending upon your need you can achieve migrating WordPress website in few ways:

  • using a plugin like Duplicator
  • moving files and databases manually via control panels like cPanel, Plesk
  • using third-party services or help

For me, since I was using Plesk with DigitalOcean to host and manage my websites things happened to be lot easier.

Grow your YouTube channel with TubeBuddy. Join Today!



tubebuddy

Since I wanted to keep my website with Plesk but move the website to the new domain name, all I had to do is rename the Domain name in Plesk hosting settings. This would automatically update all necessary settings.

So what I did was changed the domain name blog.lakshmanbasnet.com to lakshmanbasnet.com is the Plesk website’s hosting settings.

Pointing DNS to new hosting address with Cloudflare

If you are following this guide, we’ve renamed our Plesk’s website’s domain name but there is one major job still undone. If anyone visits our website it will still take to the previous hosting location as pointed by the website DNS.

Up to now, lakshmanbasnet.com is still pointing to “Y Plesk Server”, so to point the root domain to a new address (but old for blog.lakshmanbasnet.com) i.e the X Plesk Server, all I needed to do was to add/ change the A record and point it to X Plesk Server’s IP address.


Your Gift of $200 Cloud Hosting Credit is Here. Claim Now!

Ensuring WordPress settings are correct

Now the website was running from the new address, it is time to make sure that WordPress is functioning well. Logging in to WordPress dashboard, these were some quick settings to check for:

  • Website address URL and site address
    Most of the time, WordPress automatically updated the address URL and site address when it is running from a new location but it is always wiser to check first. We need to make sure WordPress knows the right URL.
  • Save permalinks and media settings to ensure the links are automatically updated in case the URLs don’t get auto-updated after migrating or changing the websites site address.

Directing visitors to the new address

After we have moved the website to the new address, it is necessary to inform and direct the visitors to the right address. This avoids the chances of losing the traffic and making it harder for audiences to find the website.

Redirecting visitors to a new address from the old address with 301 Permanent redirect

Since the website is moved to a new address, visitors visiting the old address mightn’t be able to get to the right page they are intending. By adding a permanent redirect we can redirect the visitor from one address to other permanently. This is important for SEO as well.

301 permanent redirect can be done in any of the following ways

  • editing .htaccess file and adding the following line of code
RewriteEngine on
RewriteCond %{HTTP_HOST} ^blog.lakshmanbasnet.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.blog.lakshmanbasnet.com [NC]
RewriteRule ^(.*)$ https://lakshmanbasnet.com/$1 [L,R=301,NC]  

For more about 301 redirect visit this guide from ahrefs.com

Recommended for you:




    Informing Google through Search Console the change of address

    My old web address blog.lakshmanbasnet.com has a lot of indexed and ranked blog posts, that I don’t want to lose the search results after changing to a new domain. It is a good practice to inform Google about the change of address. This will help Google to better understand the redirection and update the indexed URLs to the new ones. While this might take a considerable amount of time, this shouldn’t be skipped.

    To let know Google about the change of address, please go to Google Search Console settings and select a new address (which must be already added to the Search Console as a property) and verify the changes.
    The search console will look for 301 permanent redirects and few sample URL tests to ensure the redirects are working well. For more information visit this link.

    Updating audiences with the changes

    Once all the changes are completed, it is a good practice to notify the audiences about the domain change. This can be done through relevant social media, mailing to a subscription list or a small banner on the website.

    1 minute Summary

    Here is a quick summary of what I did to move my WordPress website at blog.lakshmanbasnet.com to lakshmanbasnet.com.

    Before you go, let's stay connected
    About the Author
    Lakshman Basnet
    Nepali Digital Media Marketer currently based in Adelaide, South Australia who apart from playing with his cat - Eleven, also enjoys developing web content, publishing blogs and YouTube videos in his free time.

    Leave a Comment