• Skip to main content
  • Skip to primary sidebar
BMA

BeMyAficionado

Inspire Affection

Port Existing WordPress Website to New Domain Without Losing SEO Ranking

April 11, 2017 by varunshrivastava Leave a Comment

In this article, you will learn to port existing WordPress website to a different domain.

If you are a returning user of this website then you will observe that the domain of the website has been changed without affecting anything else. Well, we have recently moved to a new .com (www.bemyaficionado.com) because of endless reasons which I will tell you in another article.

It was kind of challenging for me as this was my first time. I had not done anything like this before.

For this reason, I had to do a lot of research before making the move.

In this article I will share my acquired knowledge and experience of the entire process.

This article will surely help everyone to port existing wordpress website to a new domain.

Note: This article is for anyone who is porting his wordpress website to a new domain. It is not for someone who is porting a website to a new hosting provider I have written entirely different article. Find it here – How to port your existing website.

Table of Contents

  • Roadmap
  • Setting up the database
  • Setting up your new website
    • Redirect via Redirection Plugin
  • Redirect via .htaccess file
  • Notify Google

Roadmap

It is a good practice to carefully create a Roadmap before diving in blindly.

Roadmaps becomes even more important when your changes could compromis the entire system if gone wrong.

Following is the rough Roadmap to entire domain porting process:

  1. Secure website data. Backup all the contents of wp-content folder.
    I will leave it up to you how you secure your website content. I use git for that purpose. You can simply make a backup of your website using Duplicator plugin. It is up to you how your back your contents.
  1. Secure database.
    I use mysql database with phpmyadmin. I simply export the database from phpmyadmin console. It exports the entire database in .sql file which I can later import in my new database.Alternatively, if you have access to terminal then you can fire following command:

    mysqldump --databases test > dump.sql
  1. Download latest wordpress from the official website.
    Navigate to www.wordpress.org and download the latest wordpress package in zip file. Extract the file and you will get a wordpress folder.
  1. Replace wp-content folder of latest downloaded wordpress with the backed up wp-content folder.
    Now you will have to replace everything which is there in wp-content folder of newly downloaded wordpress folder with everything inside of your backed up wp-content folder. You can directly copy the files to the new wordpress folder.
  1. Upload the latest wordpress folder to the server.
    Once you have replaced the wp-content folder of the wordpress, it is now time to upload this folder to your hosting server. You can use filezilla to do that.I prefer git as it is faster, easier and secure. I use Digital Ocean’s cloud hosting to host my website as I like to have full control over each and every part of the website and server.

    If your website is hosted on shared hosting provider then you must first confirm whether you can host more than one website with it. If you can host multiple websites then create a new folder and upload the wordpress setup in it.

Setting up the database

I’m assuming that you are using mysql database and you have your .sql file.

Now, login to your phpmyadmin panel and create a new database with whatever name you want your new website to be.

Usually I name database by the name of the website. Since, it is a preference of choise you can choose any name for your database.

Once you have created the database, it is time to import that .sql file into it.

It is really simple, select the database and click import button from the tab. It will take you to a file import view. Use the file select to select the file and upload it. Refer the snapshot below.

phpmyadmin sql import

Once you have uploaded the file successfully, you will see the list of all the tables in the left sidebar under the selected database.

It is time to change the meta information about your new website from the database.

Select wp_options table from the left sidebar.

You will see the url of your old website in the first and second row of the table. Replace this URL with the new Domain.

That is all you need to do to port your existing database.

It is time to setup the new website

Setting up your new website

You need to point your domain to your new location. If you on a shared hosting then ask your provider to guide you on how to point domain name to the location. For those of you who are on the cloud hosting then you must point your new domain to your hosting server and use virtual host to proxy all the request coming from the new domain. If you have your website hosted on digital ocean then follow their article on setting up virtual host for your website.

If you have successfully setup the website then probably you would see a wordpress setup wizard like the one mentioned below.

Provide all the credentials for the database which we setup in the previous section. WordPress automatically detect the setup and prompt you with the login button. Login into your admin panel with the same credentials that you used to in the previous website.

At this moment, you have a website with working backend and frontpage. But all the links of the website is broken. Also all widgets mightl be disturbed.

So, just make sure you have everything in the right place.

Next thing you need to do is fix the links of the website. For that, click on setting > permalink and then click on the save button. It will automatically make the required changes.

That is all you need to do in order to port your website to a new domain But this is just half the part of the whole story. The main thing comes at the SEO level.

Here , you need to provide 301 redirects for the moved pages This part can be very tricky depending upon your requirements.

In my case, I had two different applications built on two different frameworks installed under the same domain

One application was based on WordPress and the other was built on CodeIgniter from scratch.

I only needed to move my wordpress website. This thing became quite complicated keeping in mind the efficiency and performance. But, in your case it might not be that difficult.

Redirect via Redirection Plugin

If you are more of a plugin guy, then this plugin will do the job for you. This is the best plugin that I have found on wordpress free plugin market which makes redirection very easy. If you have a little knowledge about regex then you can easily redirect all your pages to their new location.

Steps to redirect all requests to new domain,

  1. Install Redirection plugin.
  2. Put the below regex in the text bar of your redirection plugin.
    Add 301 redirect

    Do not forget to check the Regex checkbox next to the text box.
  3. Click on the Add Redirection button.

Now, all your request sent to your source website will be redirected to the target website with a 301 Permanently Moved header response. That is all you need to do in order to put 301 redirects on your website to redirect incoming traffic to your new website.

Redirect via .htaccess file

This is a faster way of redirection. Although the time saved is in milliseconds, so it does not have much difference unless your website is serving large amount of traffic. To redirect using .htaccess file, you will need to follow below steps,

  • Open .htaccess file present at the root of your website.
  • Paste below code at the very beginning of that file
RewriteEngine On
Redirect 301 /a-very-old-post/ http://yoursite.com/a-very-new-post/
  • Save & exit

That is all you need to do in order to redirect all users to your new website with a 301 Response header.

I found this article while searching for ways to redirect users to new domain which tells you about many other ways to redirect users with a 301 header. Here’s the article http://www.wpbeginner.com/beginners-guide/beginners-guide-to-creating-redirects-in-wordpress/

Notify Google

Last but not least, you will have to notify google about your domain migration. This is very easy. You can notify google from webmasters admin console. Follow below steps to submit a request at webmaster console,

  1. Login to webmasters console by navigating to www.google.com/webmasters.
  2. Add your new property (website) to google.
  3. Select the current website from search console and click on settings icon.
  4. Select Change of address from the dropdown.
  5. Refer the image below for further clarification,Webmaster submit domain migration request

That is all you need to do in order to port your website to a new domain. I have mentioned just the important points which you will need in order to successfully port the website to different domain. Read in depth about the above topics in your free time. This knowledge will surely help you in understanding how search engines work.

Please comment below if you have any concern or is there anything that you would like to know about.

Related

Filed Under: Wordpress N SEO Tagged With: 301, database, domain migration, port website, redirects, seo, wordpress

Primary Sidebar

Subscribe to Blog via Email

Do you enjoy the content? Feel free to leave your email with me to receive new content straight to your inbox. I'm an engineer, you can trust me :)

Join 874 other subscribers

Latest Podcasts

Recent Posts

  • Is The Cosmos a Vast Computation?
  • Building Semantic Search for E-commerce Using Product Embeddings and OpenSearch
  • Leader Election with ZooKeeper: Simplifying Distributed Systems Management
  • AWS Serverless Event Driven Data Ingestion from Multiple and Diverse Sources
  • A Step-by-Step Guide to Deploy a Static Website with CloudFront and S3 Using CDK Behind A Custom Domain

Recent Comments

  • Varun Shrivastava on Deploy Lambda Function and API Gateway With Terraform
  • Vaibhav Shrivastava on Deploy Lambda Function and API Gateway With Terraform
  • Varun Shrivastava on Should Girls Wear Short Clothes?
  • D on Should Girls Wear Short Clothes?
  • disqus_X5PikVsRAg on Basic Calculator Leetcode Problem Using Object-Oriented Programming In Java

Categories

  • Blogging
  • Cooking
  • Fashion
  • Finance & Money
  • Programming
  • Reviews
  • Software Quality Assurance
  • Technology
  • Travelling
  • Tutorials
  • Web Hosting
  • Wordpress N SEO

Archives

  • November 2024
  • September 2024
  • July 2024
  • April 2024
  • February 2024
  • November 2023
  • June 2023
  • May 2023
  • April 2023
  • August 2022
  • May 2022
  • April 2022
  • February 2022
  • January 2022
  • November 2021
  • September 2021
  • August 2021
  • June 2021
  • May 2021
  • April 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • February 2020
  • December 2019
  • November 2019
  • October 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • January 2019
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016

Tags

Affordable Hosting (4) algorithms (4) amazon (3) aoc-2020 (7) believe in yourself (4) best (4) database (4) earn money blogging (5) education (4) elementary sorting algorithms (4) experience (3) fashion (4) finance (6) Financial Freedom (7) food (7) friends (3) goals (5) google (5) india (10) indian cuisine (5) indian education system (4) java (16) life (16) life changing (4) love (4) make money (3) microservices (9) motivation (4) oops (4) podcast (6) poor education system (4) principles of microservices (5) problem-solving (7) programmer (5) programming (28) python (5) reality (3) seo (6) spring (3) success (10) success factor (4) technology (4) top 5 (7) typescript (3) wordpress (7)

Copyright © 2025 · Be My Aficionado · WordPress · Log in

Go to mobile version