Moving a WordPress installation between different development environments can be a pain. That’s why WP Engine has created tools to help you copy and deploy your WordPress sites between WP Engine installs.
When you copy or deploy an install on WP Engine using our tools, we will automatically handle the domain transformations to ensure that your WordPress install smoothly spins up in it’s new location.
Terminology
We’ll use the following terms throughout this article:
Source – this is the WordPress Install that you are copying or deploying to a new location.
Target – this is the destination of the copy or deploy. The target will be replaced with your source data
Transformations – the actions that our system will take to manipulate data between the source and target install to ensure your WordPress install functions in it’s new location. We use a combination of WP-CLI, regex, and string replace to handle different types of transformations.
About Find/Replace Transformations
When our platform determines it needs to perform Find/Replace transformations, it will do the following:
- Request the target & source site to resolve the primary domains for each. This usually matches the primary domain setup on the Domains page in the user portal, but not always.
- Verify Core Checksums. Modifying WordPress core is not permitted on the WP Engine platform. We verify that your core files are not modified for security reasons and will not allow a copy or deploy to complete.
- You will receive a failure email if we detect your core files have been modified. You can update or reinstall WordPress core by visiting: site.com/wp-admin/update-core.php
- Perform domain replacements:
- Leveraging WP-CLI, we will run a protocol-less and case-insensitive search for the source domain and replace it with the target’s domain. We have various case checks that will catch the following replacements (including in serialized data):
- source.com -> target.com
- We support the transformation of the following URL cases:
- new long TLDs (like .solutions)
- Punycode TLDs ( like test.XN–VERMGENSBERATUNG-PWB)
- Second level TLDs (like test.co.uk)
- We support the transformation of the following URL cases:
- www.source.com -> www.target.com
- subdomain.source.com -> subdomain.target.com
- source.com/path -> target.com/path
- <a href=”source.com”>source.com</a> -> <a href=”target.com”>target.com</a>
- Our transform cases include adjustments to account for the following characters which may come before or after a domain URL:
- Blank spaces
- New lines
- Brackets [ ]
- Parenthesis ( )
- Curly Brackets { }
- Angle brackets < >
- Our transform cases include adjustments to account for the following characters which may come before or after a domain URL:
- Handle URLs in an image’s file path
- /wp-content/www.source_.com_.png -> /wp-content/www.source_.com_.png
- We will NOT transform email address, and thus [email protected] will stay [email protected].
- source.com -> target.com
- Leveraging WP-CLI, we will run a protocol-less and case-insensitive search for the source domain and replace it with the target’s domain. We have various case checks that will catch the following replacements (including in serialized data):
- Purge site caches:
- Clear WordPress object & transient cache, if enabled (internal WordPress caches)
- Flush HTML page cache (cached dynamics)
- Clear CDN cache (cached statics)
- Fix site permissions
- Verify and force any file permissions to be reset to proper defaults.
Integrated Tools
We have standardized this find/replace transformation process and have integrated it with various tools on the WP Engine platform.
New Install from Copy
When leveraging the “Add Install” tool, you have the option to “copy from” this will trigger a transformation of the source install you are copying to your newly created target install.
Restore Backup to Another Install
When restoring one install’s backup (source) to another different install (target), a find/replace transformation will be performed.
Deploy Site
When deploying one install (source) to another (target), a find/replace transformation will be performed.