Move wordpress site to a new domain

This article is about moving WordPress site to a new domain. There are three Methods described here

Method 1 – WordPress site is working on the old domain

If your WordPress site is working on the old domain and you want to move it to a new domain try the WordPress plugin duplicator https://wordpress.org/plugins/duplicator/

Install this plugin in your WordPress admin area. Using this plugin you can create a zip archive of your site and an installer. Upload both the files to your hosting server at the new domain name and run the installer.php from your browser. The installer will create the website database and move the files to your new domain. Make sure that you select an empty database. The installer will ask you the database host name and the database name.

Method 2 – WordPress site is NOT working on the old domain

You should have access to your WordPress site via ftp. Download the contents of your old site using ftp. Once you have downloaded the files, upload the files to your new hosted domain via ftp

Take a MySQL backup of your database on the old domain using PhpMyAdmin. Create a new database using phpMyAdmin for your new domain. Import the old database to the new database you have created.

In your new database go to the table wp_options . Change the value of the fields site_url and the home to your new domain for example https://example.com

Open the file wp-config in the root directory of the new domain name using ftp. After you have opened the file for editing insert the following code after the

@Package WordPress
*/

The edited code should now look like

@Package WordPress
*/

define('WP_HOME', 'https://newdomain.com');
define('WP_SITEURL', 'https://newdomain.com');

Save the file and upload it to the root folder of your new domain name.

You should now be able to login to your WordPress admin area using your old admin username and password

Install the plugin https://wordpress.org/plugins/better-search-replace/ and replace old_domain.com with new_domain.com . Make sure to select all tables while using the plugin.

Method – 3 – The WordPress export tool is working in the admin area of the old site

Download and install a fresh WordPress at your new domain name

Using the export tool export all content from the Admin Area of the old website(by choosing the option under export). WordPress will create a XML file as backup.

Upload the contents of the themes directory to your new domain.

Upload the contents of the uploads directory to the uploads folder of your new site

Under WordPress on the new site’s admin area, go to the import tool and install the WordPress importer

Import the XML file you have downloaded

You should be able to see your WordPress posts and pages. Change the theme in the Admin area to the old theme you were using.

You will have to re-install the plugins.



That is all.

If you liked this article please do leave a reply and share it with friends.

Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.