best way to migrate a WordPress site to a new domain
Today in this article, we discuss the best way to migrate a WordPress site to a new domain. Moving a WordPress site to another domain can appear to be overwhelming; however, with an organized methodology, it tends to be done effectively and without a hitch. We deeply discuss the best way to migrate the WordPress site to the new domain below.
This guide will walk you through the cycle bit by bit, guaranteeing that your site stays in salvageable shape and functional during the progress. Let’s start our discussion about the best way to migrate the WordPress site to a new domain.
Step 1: Prepare for Migration
In this section, we give step-by-step directions on the best way to migrate the WordPress site to a new domain.
Backup Your Website
Prior to rolling out any improvements, make a total reinforcement of your site. This incorporates your WordPress documents, topics, modules, and the data set.
You can utilize modules like UpdraftPlus, Duplicator, or Across the Board WP Movement to make a reinforcement. Store this reinforcement securely on your nearby PC or distributed storage.
Choose Your New Domain
Ensure you have registered your new domain and configured it with your hosting provider. Point the DNS settings to your hosting server if you haven’t already done so.
Step 2: Prepare for New WordPress Site Installation
Introduce WordPress to your new domain. Guarantee this new establishment is set up accurately and that you can get to the WordPress dashboard.
Step 3: Transfer Your WordPress Files
Export Your Database
- Log in to your existing website’s hosting control panel (cPanel, Plesk, etc.).
- Open phpMyAdmin and select your WordPress database.
- Click on the “Export” tab, choose the “Quick” export method, and select “SQL” as the format. Tap “Go” to download the database file.
Import the Database to the New Domain
- Log in to the hosting control panel for your new domain.
- Open phpMyAdmin and create a new database (if one doesn’t already exist).
- Click the “Import” tab to select a new database.
- Choose the SQL file you exported from your old domain and click “Go” to import it.
Step 4: Update the WordPress Configuration File
- On your new domain, locate the `wp-config.php` file in the root directory of your WordPress installation.
- Open this file and update the database name, username, and password to match the database you imported.
PHP code:
Update these lines with your new database information
- define(‘DB_NAME’, ‘new_database_name’);
- define(‘DB_USER’, ‘new_database_user’);
- define(‘DB_PASSWORD’, ‘new_database_password’);
- define(‘DB_HOST’, ‘localhost’);
Step 5: Update URLs in the Database
When migrating to a new domain, you need to update all instances of the old domain URL to the new domain URL in the database.
- Use a plugin like Better Search Replace or run the following SQL query in phpMyAdmin:
SQL code:
- UPDATE wp_posts SET guide = replace(guide, ‘http://old-domain.com’, ‘http://new-domain.com’);
- UPDATE wp_postmeta SET meta_value = replace(meta_value,’http://old-domain.com’,’http://new-domain.com’);
Step 6: Transfer WordPress Files
Using an FTP client or the File Manager in your hosting control panel, upload all your old site’s files (themes, plugins, uploads, etc.) to the new domain’s WordPress directory, overwriting the existing files.
Step 7: Test Your New Site
Before making your new site live, thoroughly test it to ensure everything is working correctly. Check links, images, plugins, and functionality to ensure there are no issues.
Step 8: Redirect Traffic to the New Domain
To preserve SEO rankings and ensure visitors are redirected to the new domain, set up 301 redirects.
- Access your old domain’s `.htaccess` file.
- Add the following lines to redirect all traffic to the new domain:
apache code:
RewriteEngine On
- RewriteCond %{HTTP_HOST} ^old-domain.com [NC,OR]
- RewriteCond %{HTTP_HOST} ^www.old-domain.com [NC]
- RewriteRule ^(.*)$ http://www.new-domain.com/$1 [L,R=301,NC]
Step 9: Inform Google About the Change
To help Google update its index and prevent any negative impact on your search rankings, inform Google about your site’s new address.
- Log in to Google Search Console.
- Add and verify your new domain.
- Go to the old domain’s property, select “Change of Address” from the settings menu, and follow the instructions to notify Google of the domain change.
Step 10: Update Social Media and External Links
At last, update your domain on all web-based entertainment profiles, professional resources, and whatever other outside destinations connect to your old domain. This guarantees that all traffic is coordinated to the ideal locations and forestalls broken joins.
Tips for Updating External Links:
- Update your website URL on social media profiles (Facebook, Twitter, LinkedIn, Instagram).
- Notify partners, affiliates, and any other websites that link to your site to update their links.
- Use online tools to find and update backlinks.
Additional Tips for a Smooth Migration
We already know the best way to migrate a WordPress site to a new domain. Now we get additional tips for a smooth migration.
- Check for Broken Associations: Use gadgets like Broken Association Checker to perceive and fix broken joins on your new domain.
- Screen Site Execution: Use Google Assessment and Google Search Control focus to screen your site’s show and recognize any issues post-migration.
- Talk with Your Group: Enlighten your group about the migration through blog passages, leaflets, and online diversion updates to ensure they are familiar with the new region.
More Information
SSL Certificate
Ensure you obtain and install an SSL certificate for your new domain to maintain secure HTTPS connections, which are crucial for security and SEO.
Custom Permalinks
After migration, check your permalink structure under Settings > Permalinks to ensure it matches your old domain setup, preserving SEO benefits and user experience.
XML Sitemap
Generate and submit an updated XML sitemap to search engines through tools like Google Search Console and Bing Webmaster Tools, helping them crawl and index your new domain efficiently.
Last Of All
We hope you understand our best way to migrate the WordPress site to a new domain post. Migrating a WordPress site to a new domain involves careful planning and execution. By following these steps, you can ensure a smooth transition with minimal downtime and maintain your search engine rankings.
Remember, preparation and thorough testing are key to a successful migration. If you would like our best way to migrate the WordPress site to a new domain post, please share!