Move a Domain Between Environments

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 to finish taking it live.

In most cases, the easiest way to take a new design is to copy to your Production environment. To do so simply use the Copy Site tool. If you copy in this way, your domain does not need to be moved from one environment to another.

If you are taking another environment live and copying nothing back to the existing Production environment (where the domain currently lives), then the domain would need to be moved. Follow these steps in exactly this order to move your domain successfully and with minimal potential downtime.

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.


Update DNS

As the environment name is different, the WP Engine CNAME (environment.wpestaging.qa) and even the IP address may be different. You will need to be sure your DNS has been configured to direct traffic to the new environment CNAME or IP address, or the later steps will result in a 404 error.

For example, say your current live environment (where the domain is currently mapped) is called 2017site.wpestaging.qa and new environment called 2020site.wpestaging.qa (where the domain needs to be moved to).

You would log in to your DNS host and update any records where you see 2017site.wpestaging.qa to 2020site.wpestaging.qa

Similarly, if you are pointed with an A record to a static IP address, you’d log in to your DNS host and update anywhere you see the old environment’s IP to the new IP address (if they are different).

If you are using GES, your GES CNAME will also be impacted by changing the environment names and DNS must be updated accordingly.

  1. Locate the DNS record values for your new environment
  2. Log in to your DNS host and update your DNS records to the new values


Remove Domain from Old Environment

A domain cannot be added to two environments at once. This means you must first remove your domain from your original site.

  1. Log in to the User Portal
  2. Click on the environment name the domain is currently mapped to
  3. Click Domains
  4. Locate the WP Engine CNAME of the domain you will be moving: environment.wpestaging.qa
  5. Next to this CNAME, click the 3 dot menu icon ...
  6. Select Set as primary
  7. Locate the domain name you will be migrating
  8. Next to this domain, click the 3 dot menu icon ...
  9. Click Delete

NOTE: The domain may be added here twice, once with www and once without, be sure to delete both versions of your domain.


Add Domain to New Environment

Now you’ll need to map the domain to the new environment, so our severs know which environment the domain should send traffic to.

  1. Log in to the User Portal
  2. Click on the environment name the domain will be moved to
  3. Click Domains
  4. Click Add Domain
  5. Enter the domain name and click Add
    • Typically you’ll need to add the domain a total of two times (once with and once without www)


Update WordPress URL

Now that you’ve told both DNS and WP Engine servers where to send traffic, you must tell WordPress which domain you want it to load over.

  1. Log in to the wp-admin dashboard of your new environment
  2. Click Settings
  3. Select General
  4. Update two values to your domain:
    1. WordPress Address (URL)
    2. Site Address (URL)

Additional steps for updating your WordPress URL can be found in our guide here.

NOTE: If you’re updating the primary domain within a multisite, you will want to follow our guide here.


(Optional) Perform a search and replace

After changing your domain on the new environment you may notice some internal links on your website are still using the environment.wpestaging.qa URL. To correct this you will need to perform a search/replace on your website’s database. This will change all hard-coded references of the old domain in your database to your live production domain.

Search and replace plugins:


NEXT STEP: Need to migrate part of a site? Learn how to perform a partial copy using backups

Need more Sites?

Each Site includes Development, Staging, and Production environments. Get more Sites for your account as an add-on without upgrading your whole hosting plan.