How to Change Your Hosting Account’s Primary Domain Name (Complete Guide)
Changing your hosting account’s primary domain name requires careful planning to avoid website downtime, email disruptions, and SEO impacts. This comprehensive guide walks you through the entire process.
Understanding Primary vs. Addon Domains
Primary Domain:
- The main domain associated with your hosting account
- Typically used for accessing your hosting control panel
- Often the first domain you set up with your host
Addon Domains:
- Additional domains hosted on the same account
- Function independently but share server resources
Pre-Migration Checklist
Before making any changes:
- Backup everything (files, databases, emails)
- Note current DNS settings (nameservers, A records, MX records)
- Check SSL certificates (expiration dates, installation)
- Document email accounts and configurations
- Review subdomains and associated services
- Prepare new domain (register it if you haven’t)
Step-by-Step Migration Process
1. Contact Your Hosting Provider
Most hosts require you to:
- Submit a support ticket for primary domain changes
- Verify account ownership
- Schedule the change during low-traffic periods
Pro Tip: Some providers may need to create a new hosting account rather than modify the existing one.
2. Set Up the New Domain
A. If keeping same host:
- Add the new domain as an addon domain first
- Test functionality before making it primary
B. If changing hosts:
- Set up new hosting account with the new domain
- Migrate all content before changing DNS
3. Transfer Website Files
Methods:
- cPanel/WHM: Use backup/restore functions
- FTP: Manually download and upload files
- SSH: Use rsync for large sites
- Host-provided migration tools
4. Migrate Databases
- Export all databases from old account
- Create new databases on destination
- Import data
- Update configuration files (wp-config.php, etc.)
5. Update All References to Old Domain
Search and replace:
- Database content (use tools like WP-CLI or Search-Replace-DB)
- Configuration files
- .htaccess rules
- Hardcoded links in themes/plugins
6. Email Migration
Options:
- Forwarding: Temporary solution during transition
- IMAP sync: Copy emails between accounts
- Manual export/import: Via email clients
- Professional tools: Like imapsync
7. DNS Configuration
Critical records to update:
- Nameservers (if changing hosts)
- A records (pointing to your IP)
- MX records (for email delivery)
- CNAME records (for subdomains/services)
- TXT records (for verification/authentication)
8. SSL Certificate Installation
- Generate CSR for new domain
- Install new SSL certificate
- Set up proper redirects from HTTP to HTTPS
- Update any certificate pinning (HPKP)
Post-Migration Steps
1. Testing
Verify:
- Website loads at new domain
- All internal links work
- Forms submit correctly
- SSL certificate is valid
- Email sending/receiving
2. Redirects Implementation
Essential redirects:
- Old domain → New domain (301 permanent)
- All old URLs → New equivalent URLs
- WWW/non-WWW consistency
- HTTP → HTTPS
.htaccess example:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]
3. Search Engine Considerations
- Google Search Console:
- Add new property
- Submit sitemap
- Request indexing
- Google Analytics:
- Update default URL
- Create new views if needed
- Bing Webmaster Tools:
- Add new site
- Submit URLs
- Update all SEO tools (Ahrefs, SEMrush, etc.)
4. Monitoring
Set up:
- Uptime monitoring
- Broken link checking
- SSL expiration alerts
- Email delivery monitoring
Common Pitfalls to Avoid
- Changing DNS too early before content is migrated
- Not testing email functionality before cutting over
- Forgetting to update third-party services (payment gateways, APIs)
- Improper redirects causing SEO loss
- Not communicating the change to users/customers
Timeline Recommendation
- Preparation (1-2 weeks): Backups, documentation
- Migration (1-3 days): Content transfer, testing
- DNS Cutover (immediate): Change nameservers/A records
- Post-migration (2-4 weeks): Monitoring, fixing issues
- Sunsetting old domain (60+ days): Maintain redirects
When to Seek Professional Help
Consider hiring an expert if:
- Your site has complex custom applications
- You’re running e-commerce with live transactions
- You have multiple interdependent services
- You lack technical confidence in the process
By following this comprehensive guide, you can successfully change your hosting account’s primary domain while minimizing disruption to your online presence. Remember that the exact steps may vary slightly depending on your specific hosting provider and website setup.
Would you like me to elaborate on any specific aspect of this migration process?