Migrate to Another Domain
If you want to deploy your site e.g. from dev.mysite.com to mysite.com, you'll have to perform the following steps to make it work easily:
- Move your site as usual.
- Run the prepared SQL query as shown below to migrate the WPCE contents.
TIP
Use this tool to build the SQL queries: tools.ownb.it/deployment
Replace URLs in WPCE Content
Have a look at this query:
sql
UPDATE wp_postmeta
SET meta_value = TO_BASE64(replace(FROM_BASE64(meta_value),
'https://dev.mysite.com',
'https://mysite.com'))
WHERE meta_key = '_wpce_doc';Replace URLs in General
You might need these queries right now as well:
sql
UPDATE wp_postmeta
SET meta_value = replace(meta_value,'https://dev.mysite.com','https://mysite.com');
UPDATE wp_options
SET option_value = replace(option_value,'https://dev.mysite.com','https://mysite.com');
UPDATE wp_posts
SET post_content = replace(post_content,'https://dev.mysite.com','https://mysite.com');However, since there are tools (like ACF) that store some information in PHP-serialized strings, it often is preferable to use a dedicated tool for the job.
Better Search Replace is such a tool; it's a plugin which replaces strings in the WordPress database. Use it to replace https://dev.mysite.com with https://mysite.com and, with a high degree of certainty, you'll be fine.