How to Migrate WordPress to New Domain

By Faiq 10 min read

Migrating WordPress to a new domain requires careful planning and execution. Learn the step-by-step process, common pitfalls to avoid, and how HostWP's free migration service can simplify the transition for your South African business.

Key Takeaways

  • WordPress domain migrations require updating the site URL in Settings, database search-replace, and SSL certificate reconfiguration to avoid broken links and SEO loss
  • Plan your migration during off-peak hours to minimize traffic disruption, especially critical for SA businesses relying on Johannesburg fibre infrastructure and during load shedding windows
  • Update DNS records, test thoroughly on staging, and implement 301 redirects from your old domain to preserve search rankings and user traffic

Migrating your WordPress site to a new domain is one of the most critical tasks a website owner will undertake. Done correctly, it's seamless. Done carelessly, you risk broken links, lost SEO rankings, and confused visitors. In this guide, I'll walk you through the exact process we use at HostWP when handling domain migrations for our South African clients—from pre-migration planning through post-launch verification.

Whether you're rebranding your business, consolidating multiple sites, or simply moving to a more memorable domain name, the technical steps remain consistent. The key is understanding what happens behind the scenes when you change your domain and preparing for each stage methodically.

Before You Migrate: Planning and Preparation

The success of your domain migration depends entirely on how thoroughly you plan before touching anything live. Begin by documenting your current setup: note your existing domain, hosting provider details, installed plugins, theme version, and any custom code. I always recommend scheduling migrations during your lowest-traffic hours—for South African sites, this often means early Tuesday or Wednesday mornings, well before the typical 9 AM-5 PM business window when your Johannesburg or Cape Town audience is most active.

Check your current domain registrar and hosting provider contracts. Some registrars charge transfer fees (typically R50–200 in ZAR), and you'll need administrative access to update nameservers. Verify that your new domain is registered and ready. At HostWP, we recommend having your new domain active and pointing to a staging environment for at least 24 hours before the final cutover. This allows DNS propagation to begin naturally, reducing the migration window.

Create a detailed migration checklist covering: SSL certificate status on both domains, plugin compatibility, theme functionality, any custom post types or custom fields, WooCommerce product data (if applicable), and third-party integrations like email services or payment gateways. Account for South African-specific considerations—if you're running an e-commerce site, test payment gateway integrations carefully, as providers like PayFast and Yoco have domain validation rules.

Faiq, Technical Support Lead at HostWP: "In our experience migrating over 500 South African WordPress sites, nearly 30% of problems arise not from the technical migration itself, but from incomplete pre-migration planning. We've seen businesses lose hours of downtime because they hadn't tested email notifications or updated API keys before going live on the new domain."

Backup Your Entire WordPress Installation

Before making any changes, create a complete backup of your WordPress installation—both files and database. This is non-negotiable. At HostWP, every client receives automatic daily backups as standard, with 30-day retention. If you're on another platform, use a backup plugin like UpdraftPlus or Duplicator to create a full backup immediately.

Your backup should include: all WordPress core files (wp-admin, wp-content, wp-includes), the wp-config.php file, the .htaccess file if using Apache, your entire uploads folder with all media files, and a complete SQL database dump. Store this backup in at least two locations—your hosting account and a secure external location (Google Drive, Dropbox, or cloud storage).

Download your backup to your local computer as well. Many South African businesses operate on unstable internet, and having a local copy ensures you're not vulnerable to bandwidth interruptions during the recovery process. Verify the backup integrity by checking file counts and database size—if your uploads folder suddenly shows 0 files, something's gone wrong.

Update WordPress Settings and Database

Once your backup is secure, update your WordPress site URL. Log in to your WordPress dashboard and navigate to Settings → General. You'll see two fields: "WordPress Address (URL)" and "Site Address (URL)". Change both to your new domain. This single step is crucial—WordPress uses these values to generate all internal links, embeds, and redirects.

However, updating the settings alone isn't enough. Your database contains hundreds (or thousands) of hardcoded references to your old domain in post content, metadata, serialized data, and plugin settings. You need to search and replace these references. The safest method is using a WordPress plugin like Better Search Replace or the native WP-CLI command.

If you're comfortable with command line access, the WP-CLI method is fastest. SSH into your server and run: wp search-replace 'old-domain.co.za' 'new-domain.co.za' --all-tables. This command updates every table in your database, including plugin settings and serialized data that visual tools might miss. If you're not comfortable with SSH, use a plugin from your dashboard. After running search-replace, verify a few posts and pages contain the new domain URLs.

Migration feeling complicated? HostWP's free migration service handles the entire process for you—from database updates to SSL configuration—with zero downtime. Our Johannesburg-based team completes most migrations in under 2 hours.

Get a free WordPress audit →

Configure SSL and Update DNS Records

Your new domain must have an SSL certificate to function securely in 2025. If you've just registered the domain, request a free SSL certificate immediately. At HostWP, all plans include free, auto-renewing Let's Encrypt SSL certificates. Many registrars (including local South African providers like Afrihost and Xneelo) also offer free SSL, though renewal processes vary.

Install the SSL certificate on your new domain before changing your DNS records. This prevents visitors from seeing security warnings when they arrive at your new domain. If your new domain is already on HostWP's servers, the SSL installation is automated—you'll see it active within minutes of domain configuration.

Next, update your DNS records at your registrar. You'll need to change your nameservers (NS records) or update A/CNAME records, depending on your setup. If migrating to HostWP, you'll point your domain to our Johannesburg nameservers: ns1.hostwp.co.za and ns2.hostwp.co.za. If staying with your current host, update the A record to point to your new server IP address.

DNS propagation typically takes 24–48 hours, though it often completes within 4–6 hours. During this window, some visitors will see your old site, others your new one—this is normal. Avoid making further changes during propagation. After 48 hours, verify DNS propagation using a tool like mxtoolbox.com or google.com's DNS checker. Once confirmed, your new domain is live.

Testing, 301 Redirects, and Launch

Before declaring the migration complete, test your site thoroughly on the new domain. Check: homepage loads correctly, internal navigation works, images display, forms submit without errors, search functionality works, and WooCommerce (if applicable) processes transactions. Load each critical page in multiple browsers and on mobile devices.

Next, implement 301 permanent redirects from your old domain to the new one. This tells search engines and visitors that your site has permanently moved, preserving your SEO rankings. If your old domain is still on your previous host, add a redirect in the .htaccess file (on Apache servers):

RewriteEngine On
RewriteRule ^(.*)$ https://new-domain.co.za/$1 [R=301,L]

If your old domain is on HostWP, you can set up a redirect through your cPanel or via a simple WordPress plugin like Safe Redirect Manager. Keep your old domain active and pointed to these redirects for at least 6 months—Google's SEO guidelines recommend this timeframe to consolidate ranking signals on the new domain.

Notify Google of the migration through Search Console. Add your new domain property, verify ownership, and use the "Address Change" tool to tell Google you've moved. This accelerates the ranking transfer process. Update your POPIA privacy policy if you mention your domain URL, and notify any POPIA-regulated third parties (email providers, CRM systems) of your new domain for compliance purposes.

Post-Migration Monitoring and Cleanup

After launch, monitor your site closely for 48–72 hours. Check error logs for any 404 errors or database connection issues. Most sites experience minor hiccups in the first 24 hours as caches clear and DNS fully propagates across the internet. If you're using Cloudflare (which is standard on HostWP plans), purge the cache to ensure fresh content loads immediately.

Update any external references to your old domain: change URLs in Google Analytics, Bing Webmaster Tools, Facebook Pixel, email signatures, and social media profiles. If you've built backlinks from external sites, reaching out to those site owners with your new URL helps them update their links faster, improving your link equity transfer.

After a week, check Google Search Console to confirm your site is indexed under the new domain. If Search Console shows errors, investigate them immediately—common issues include redirect chains, SSL certificate problems, or robots.txt blocking your new domain. Monitor your traffic in Google Analytics; you should see a gradual shift from the old domain property to the new one over 4–6 weeks.

Keep your old domain active with 301 redirects for at least 6 months. Don't immediately cancel the hosting or let the domain expire. After 6 months, you can safely discontinue the old domain, though some SEO practitioners recommend keeping redirects indefinitely as a safety net. During load shedding periods in South Africa, ensure your old domain's hosting remains online (if cost-prohibitive, simply keep DNS redirects active to your new domain).

Frequently Asked Questions

Q: How long does a WordPress domain migration actually take?
A: The technical process (backup, search-replace, DNS update) takes 30 minutes to 2 hours depending on your site size and experience level. However, DNS propagation adds 24–48 hours, and full SEO consolidation takes 4–8 weeks. At HostWP, we handle migrations in under 2 hours, start to finish.

Q: Will my SEO rankings drop when I change domains?
A: Not if you implement 301 redirects correctly and notify Google of the change via Search Console. Google transfers ranking signals from old to new domains when proper redirects are in place. You may see a temporary 5–10% traffic dip during the first 2–3 weeks as the transition completes, but rankings typically recover within 6 weeks.

Q: Do I need to update my Google Analytics and other tools before migrating?
A: You don't need to update them before migrating, but should within 24 hours after going live. Update your domain in Google Analytics property settings, update tracking code if necessary, and verify your new domain in Google Search Console and Bing Webmaster Tools. If you delay this, you'll lose traffic attribution during the transition period.

Q: What if my new domain is already live with different content?
A: You'll need a staging server or temporary subdomain to set up WordPress on your new domain before switching the live DNS records. Point your new domain to a staging area, complete the migration there, test thoroughly, then switch DNS to go live. Many hosts offer free staging environments—HostWP includes staging as standard.

Q: Can I migrate WordPress between different hosts (e.g., from Xneelo to HostWP)?
A: Yes, absolutely. The process is identical whether you're moving domains or hosts—backup, search-replace, and DNS update. The advantage of migrating to HostWP is that we handle the entire process for free, including setup on our Johannesburg infrastructure, LiteSpeed caching optimization, and daily backups. Most migrations take under 2 hours.