Even if you have a primary domain set up correctly in WPEngine, sometimes when you copy back from Legacy Staging to live, instead of replacing the staging url MYSITE.STAGING.WPENGINE.COM with the real domain, it will be replaced with a wpengine address like MYSITE.WPENGINE.COM.
There are two steps to fixing this.
First, it’s handy to download a copy of the wp-config.php before overwriting live from staging. WPEngine erroneously adds the incorrect domain to wp-config in the migration. You can re-upload the original wp-config after copying the site or use it for comparison.
Second, you need to search and replace the domain (eg MYSITE.WPENGINE.COM) for the real domain in the database using a serialized search and replace tool.
While you are using the search and replace, you should also look for the staging url and change any instances that may have been missed in the copy. The copy can also miss converting instances of the staging URL.
It’s often necessary to clear the WPEngine cache when making these changes. If you can’t get to the dashboard of the site to do it, you can do it within the WPEngine dashboard.