I have just moved this site to a new domain wp.gaeflex.ninja from the old domain tmatsuo-wordpress.appspot.com. I bought this nice domain gaeflex.ninja at Google Domains. It was very smooth 🙂 Then I bought cheap SSL certificate at about $5.00/year at https://www.ssls.com/.

I configured the domain mapping and uploaded the certificate and the private key on the App Engine Setting section in the Cloud Console. Then rewrote the database with the wp-cli tool installed in the vendor directory.

Took the backup just in case:

$ vendor/bin/wp db export --path=wordpress

`–dry-run` allows you to see the changes without overiding them:

$ vendor/bin/wp search-replace --dry-run \
  'tmatsuo-wordpress.appspot.com' 'wp.gaeflex.ninja' \
  --skip-columns=guid --path=wordpress

The command below actually overrides the values.

$ vendor/bin/wp search-replace \
  'tmatsuo-wordpress.appspot.com' 'wp.gaeflex.ninja' \
  --skip-columns=guid --path=wordpress

It’s working well so far. If you bookmarked this site, please change the URL to the new domain.

The URLs of the media files in the posts are incorrectly changed, so I needed to manually fix them.
Now I put the following few lines at the top of the nginx-app.conf:

if ( $host = 'tmatsuo-wordpress.appspot.com' ) {
  return 301 https://wp.gaeflex.ninja$request_uri;

so that all the requests to the old domain will be redirected to the new domain.

Leave a Reply

Your email address will not be published. Required fields are marked *

By submitting this form, you accept the Mollom privacy policy.