Moving your WordPress site to a new domain is a significant operation that, if done incorrectly, can destroy your search engine rankings and break your site. Whether you are rebranding, switching from a .com to a .co.tz domain, or consolidating multiple sites, this guide provides a step-by-step process to migrate your WordPress site to a new domain while preserving your SEO value. All instructions are tailored for SakuraHost customers.

Before You Start

Important: A domain change will cause a temporary dip in search rankings regardless of how well you execute the migration. Google needs time to re-crawl and re-index your content under the new domain. Expect 2-4 weeks for rankings to stabilize. Plan your migration during a low-traffic period.

Pre-Migration Checklist

  • New domain registered and pointing to your SakuraHost nameservers
  • SSL certificate issued for the new domain (SakuraHost provides free AutoSSL)
  • Full backup of files and database completed
  • Access to Google Search Console for both old and new domains
  • List of all external services using your old domain (Google Analytics, social media profiles, business directories, email services)

Step 1: Create a Complete Backup

Back Up Everything

Use UpdraftPlus or cPanel Backup to create a full backup of your WordPress files and database. Download copies to your local computer. This is your safety net if anything goes wrong.

Step 2: Set Up the New Domain

Configure DNS and Hosting
  1. Add the new domain to your SakuraHost cPanel as an Addon Domain or set it as the primary domain
  2. Ensure DNS A records point to your server IP
  3. Wait for DNS propagation (typically 1-24 hours, use dnschecker.org to verify)
  4. Issue an SSL certificate via cPanel > SSL/TLS Status

Step 3: Copy WordPress Files

Duplicate Your Installation

If the new domain is on the same server, copy the entire WordPress directory to the new domain's document root via File Manager or SSH:

cp -r ~/public_html/* ~/newdomain.co.tz/

If moving to a different server, upload the backup files to the new location.

Step 4: Export and Import the Database

Database Migration
  1. Export the database via phpMyAdmin (cPanel > phpMyAdmin > Export)
  2. Create a new database for the new domain in cPanel > MySQL Databases
  3. Import the exported SQL file into the new database via phpMyAdmin > Import
  4. Update wp-config.php in the new domain's directory with the new database name, username, and password

Step 5: Search and Replace the Domain

This is the most critical step. WordPress stores the full domain URL in dozens of places in the database, including serialized data that a simple SQL REPLACE cannot handle correctly.

Option A: Use the Better Search Replace Plugin

Temporarily update wp-config.php to point to the new domain:

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

Install Better Search Replace. Go to Tools > Better Search Replace and replace olddomain.co.tz with newdomain.co.tz. Run a dry run first to preview changes, then execute.

Option B: Use WP-CLI (Advanced)

If you have SSH access:

wp search-replace 'olddomain.co.tz' 'newdomain.co.tz' --all-tables --precise

Also run for the HTTPS variant if your old site used HTTP:

wp search-replace 'http://olddomain.co.tz' 'https://newdomain.co.tz' --all-tables --precise
Never use SQL REPLACE directly. WordPress stores serialized data (arrays encoded as strings) in the database. A raw SQL REPLACE breaks serialized data because it changes string lengths without updating the length counters. Always use Better Search Replace or WP-CLI, which handle serialized data correctly.

Step 6: Set Up 301 Redirects

301 redirects tell search engines that your content has permanently moved to the new domain. This transfers approximately 90-99% of your SEO value.

Add Redirects to .htaccess on the Old Domain
RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?olddomain.co.tz$ [NC] RewriteRule ^(.*)$ https://newdomain.co.tz/$1 [R=301,L]

This redirects every URL on the old domain to the same path on the new domain, preserving URL structure.

Step 7: Update Google Search Console

Notify Google of the Move
  1. Add and verify the new domain in Google Search Console
  2. In the old domain's property, go to Settings > Change of Address
  3. Select the new domain and submit
  4. Submit the XML sitemap for the new domain

Step 8: Update External References

Update All External Services
  • Google Analytics: Update the property's default URL in Admin > Property Settings
  • Google Business Profile: Update your website URL
  • Social Media: Update website links on Facebook, Instagram, Twitter, and LinkedIn
  • Business Directories: Update your listing on Tanzania-specific directories
  • Email Signatures: Update any email signatures referencing the old domain
  • Printed Materials: Plan to update business cards, brochures, and other materials

Step 9: Monitor and Verify

Post-Migration Checks
  • Test all pages on the new domain for broken links using Broken Link Checker or an online tool like Dead Link Checker
  • Verify 301 redirects are working by visiting old domain URLs and confirming they redirect to the new domain
  • Check Google Search Console for crawl errors on the new domain
  • Monitor organic search traffic in Google Analytics for the following 4-6 weeks
  • Ensure all images and media files load correctly (no mixed content warnings)

How Long to Maintain 301 Redirects

Keep your 301 redirects active for at least 12 months, ideally permanently. This ensures that any bookmarks, external links, or cached search results pointing to your old domain continue to reach your content. The old domain must remain registered and hosted during this period.

Migration Assistance: Domain migrations are complex and the stakes are high. If you need professional help migrating your WordPress site, SakuraHost's support team can assist. Submit a ticket at billing.sakurahost.co.tz/submitticket.php with your old domain, new domain, and migration timeline.

For Google's official guidance on site moves, see the Google Search documentation on site moves.

Was this answer helpful? 0 Users Found This Useful (0 Votes)