Have a Question?

If you have any question you can ask below or enter what you are looking for!

Moving WordPress from a Subdomain to an Addon Domain on cPanel Reseller Hosting

This guide walks you through migrating a WordPress site from a subdomain (e.g. mysite.yourdomain.co.uk) to a newly added addon domain (e.g. mysite.co.uk) on your cPanel reseller hosting account.

Before you begin, make sure you have: cPanel access, the new domain’s nameservers pointed to Freethought nameservers.

Step 1: Verify DNS is Pointing to cloudabove

Before adding the domain to cPanel, confirm the new domain’s nameservers are pointing to us. You can check this using a tool like whatsmydns.net

Step 2: Add the Domain as an Addon Domain in cPanel

  1. Log in to cPanel for the reseller account hosting the subdomain site.
  2. Navigate to Domains (or Addon Domains on older cPanel versions).
  3. Click Create A New Domain.
  4. Enter the new domain name (e.g. mysite.co.uk).
  5. cPanel will auto-populate the document root, typically public_html/mysite.co.uk. You can customise this if needed.
  6. Click Submit / Create.

If the domain is already listed under Domains, skip this step.

Step 3: Move WordPress Files to the New Domain’s Directory

You need to copy (or move) the WordPress files from the subdomain’s directory to the addon domain’s document root.

  • Option A: Using File Manager in cPanel
    1. Open File Manager in cPanel.
    2. Navigate to the subdomain’s document root (e.g. public_html/mysite or a subdomain-specific directory).
    3. Select all files and folders inside.
    4. Click Copy (not Move, so you have a fallback).
    5. Set the destination to the addon domain’s document root (e.g. public_html/mysite.co.uk).
    6. Wait for the copy to complete.
  • Option B: Using SSH / Terminal
    • cp -a /home/username/public_html/mysite/* /home/username/public_html/mysite.co.uk/
    • The -a flag preserves permissions and copies hidden files (like .htaccess).

Step 4: Update WordPress URLs in the Database

WordPress stores the site URL in the database. You must update this or the site will redirect back to the old subdomain.

  • Option A: Using phpMyAdmin
    1. Open phpMyAdmin from cPanel.
    2. Select the WordPress database (check wp-config.php if unsure which database it uses).
    3. Open the wp_options table (prefix may vary).
    4. Find the rows where option_name is siteurl and home.
    5. Edit both values, changing the old subdomain URL to the new domain:
      • Old: https://mysite.yourdomain.co.uk
      • New: https://mysite.co.uk
  • Option B: Using WP-CLI (if available)
    • cd /home/username/public_html/mysite.co.uk
    • Run – wp search-replace 'https://mysite.yourdomain.co.uk' 'https://mysite.co.uk' --all-tables
    • This is the preferred method as it also catches serialised data in options, postmeta, and widgets.

If you only update wp_options and miss serialised URLs elsewhere, you may see broken images or widget settings. WP-CLI search-replace handles this automatically.

Step 5: Update wp-config.php (if needed)

Open wp-config.php in the new location and check for any hardcoded paths or URLs. If the database is the same one used by the subdomain install, no database credentials need changing. However, if you see lines like:

define('WP_HOME', 'https://mysite.yourdomain.co.uk');
define('WP_SITEURL', 'https://mysite.yourdomain.co.uk');

Update them to the new domain, or remove them entirely (WordPress will then use the database values).

Step 6: Install/Verify SSL on the New Domain

  1. In cPanel, go to SSL/TLS Status (or AutoSSL).
  2. Confirm the new domain has a valid SSL certificate, or run AutoSSL to issue one.
  3. Once SSL is active, make sure your WordPress URLs use https://.

Step 7: Test the New Domain

  • Visit https://mysite.co.uk and confirm the site loads.
  • Check the WordPress admin at https://mysite.co.uk/wp-admin.
  • Browse several pages to confirm links, images, and styles load correctly.
  • Check for mixed content warnings in the browser console (F12 → Console).

Step 8: Clean Up the Old Subdomain

Once you’ve confirmed everything works on the new domain:

  1. Optional redirect: Add a 301 redirect from the old subdomain to the new domain in the subdomain’s .htaccess:
RewriteEngine On
RewriteRule ^(.*)$ https://mysite.co.uk/$1 [R=301,L]
  1. Remove old files: Once you’re confident the new site is stable (give it a few days), delete the WordPress files from the old subdomain directory.
  2. Remove the subdomain: If it’s no longer needed, delete it from cPanel → Domains/Subdomains.

Troubleshooting

  • Site redirects to old subdomain
    • The siteurl or home values in the database still point to the old URL. Re-check wp_options and wp-config.php.
  • Mixed content warnings (padlock missing)
    • Some URLs in the database still reference http:// or the old subdomain. Run a full search-replace using WP-CLI or a plugin like Better Search Replace:
    • wp search-replace 'http://mysite.yourdomain.co.uk' 'https://mysite.co.uk' --all-tables
  • Email routing affected after migration
    • If the old subdomain was under the same cPanel account, email routing should be unaffected. If the new addon domain has its own email accounts, configure MX records and email accounts under Email Accounts in cPanel. If email was routing via the subdomain’s parent domain, no changes are needed.
  • Permissions errors or white screen
    • Ensure file permissions are correct: 644 for files, 755 for directories. Run:
    • find /home/username/public_html/mysite.co.uk -type f -exec chmod 644 {} \; find /home/username/public_html/mysite.co.uk -type d -exec chmod 755 {} \;

When to Escalate to Support

Contact cloudabove support if:

  • DNS is correctly pointed but the addon domain won’t resolve (possible server-side DNS zone issue)
  • AutoSSL repeatedly fails on the new domain
  • Database access is restricted or you’re unsure which database belongs to the site
  • The migration involves changing cPanel accounts (cross-account moves require support assistance)