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
- Log in to cPanel for the reseller account hosting the subdomain site.
- Navigate to Domains (or Addon Domains on older cPanel versions).
- Click Create A New Domain.
- Enter the new domain name (e.g.
mysite.co.uk). - cPanel will auto-populate the document root, typically
public_html/mysite.co.uk. You can customise this if needed. - 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
- Open File Manager in cPanel.
- Navigate to the subdomain’s document root (e.g.
public_html/mysiteor a subdomain-specific directory). - Select all files and folders inside.
- Click Copy (not Move, so you have a fallback).
- Set the destination to the addon domain’s document root (e.g.
public_html/mysite.co.uk). - 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
-aflag 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
- Open phpMyAdmin from cPanel.
- Select the WordPress database (check
wp-config.phpif unsure which database it uses). - Open the
wp_optionstable (prefix may vary). - Find the rows where
option_nameissiteurlandhome. - Edit both values, changing the old subdomain URL to the new domain:
- Old:
https://mysite.yourdomain.co.uk - New:
https://mysite.co.uk
- Old:
- 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
- In cPanel, go to SSL/TLS Status (or AutoSSL).
- Confirm the new domain has a valid SSL certificate, or run AutoSSL to issue one.
- Once SSL is active, make sure your WordPress URLs use
https://.
Step 7: Test the New Domain
- Visit
https://mysite.co.ukand 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:
- 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]
- 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.
- Remove the subdomain: If it’s no longer needed, delete it from cPanel → Domains/Subdomains.
Troubleshooting
- Site redirects to old subdomain
- The
siteurlorhomevalues in the database still point to the old URL. Re-checkwp_optionsandwp-config.php.
- The
- 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
- Some URLs in the database still reference
- 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:
644for files,755for 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 {} \;
- Ensure file permissions are correct:
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)