If you have developed a new version of your website in another WP Engine environment, you may need to move your domain to that new environment in the process to “go live” with the new version. In this article we will explain which steps to take and in which order, in order to successfully move your domain to a new environment.
First verify whether the domain needs to be moved
In many cases the easiest way to “go live” with a website redesign is to copy to your production environment. If this is the case, simply use the option to Copy install (if you are on a Personal, Professional, or Business plan) or Copy to/from (if you are on a Startup, Growth, or Scale plan) to copy your changes over to your production website. If you copy in this way, your domain does not need to be moved.
Steps to move a domain
If you determine that copying from the environment where you made changes is not an option, you may need to move your domain. Follow these steps in exactly this order to move your domain.
Please note: While working through these steps, you may experience a 404 error until all steps are complete. With that in mind, it is best to perform these steps at a low-traffic time.
Remove domain from original environment
After you confirm your DNS records are set properly for the new environment, remove your domain from your original site.
- Navigate to the WordPress Admin Dashboard for your original production environment. Under Settings > General, edit the domain to be the [environment].wpengine.com CNAME URL for your original production environment. This will help ensure you can continue to access this environment when the domain is switched over.
- In your User Portal, navigate to the Overview page for your original production environment. Click Domains from the left-hand navigation, and remove the domain from the list.
Your domain is now removed from the original environment.
Note IP address and CNAME and Update DNS
First, locate your current production environment’s Overview page and make a note of your CNAME and/or IP address:
Now compare this to your new environment to which you want to move your domain. Is the IP address the same? What is the CNAME?
Now look at your DNS records for your domain: Are they pointing to the correct IP address (@/A record) or CNAME?
- Note: Often times both environments will have the same IP address. If you are pointing your @/A record to the correct IP address for both environments, no changes are needed for your DNS.
- If you are using a CNAME or the IP address for your environments are different, this will need to be updated to the CNAME or IP address of your new environment instead.
Add domain to new environment
Now that the domain has been removed from your original environment, it is time to add the domain to your new environment.
- In your User Portal, navigate to the Overview page for your new environment. Select Domains from the left-hand navigation. Add your domain to the list here. Because you have already removed it from your old environment, this should not result in any errors.
- Now navigate to the WordPress Admin Dashboard for your new environment. Under Settings > General, edit the domain to be your production URL. When saved, this will lock you out of the WordPress Admin Dashboard and website. This is expected behavior until the DNS change made in the earlier steps finishes propagating.
Now that the domain has been added in User Portal and updated in the WordPress Admin Dashboard, the only thing left to do is wait until your DNS changes have finished propagating. This can take up to 24 hours for some DNS providers. If you want to speed this up, check whether your DNS provider has a “TTL” setting for your records. Lowering the TTL will speed up your propagation time.
Optional: Perform a search/replace
If when changing your domain on the new environment, you notice some internal links on your website are still using the [environment].wpengine.com URL, you may need to perform a search/replace on your website. This will change all hard-coded references of the old domain in your database to your production domain. Learn how to perform a search/replace in our help article.