Now on App Engine Standard

If you’re reading this, you’ve stumbled across the HTTPS secured and IPv6 enabled version of the Cafes. This has moved from a classic shared Linux server on pair.com to App Engine Standard on GCP. The transition is still in progress and was not without bumps.

I used Google’s instructions for setting up a new WordPress site but that only got me to an empty site. I then had to import the old data and database which was non-trivial. Surprisingly the mysqldump of the old database is only about 10 MB.

The custom theme I use here had numerous deprecated functions. I had to turn on debugging info to fix some other issues, and that revealed the deprecated functions. I’ve now updated the theme to replace those.

Chrome tells me “This page is trying to load scripts from unauthenticated sources.” That seems to have something to do with the Google and Amazon ads. I haven’t figured out how to fix that yet. Probably it’s because they’re configured for http://cafe.elharo.com and temporarily this is on https://mokka-186313.appspot.com/. I don’t see the warning on the old site. If that doesn’t go away when I repoint the domain name, I’ll have to delve deeper.

The first hard nut to crack was getting the database connection set up. My first attempt failed because I used the password for the root database user instead of the wordpress database user. A doc bug has been filed to clarify that.

The second hard nut to crack was this bit of code in wp-db.php:

if ( WP_DEBUG ) {
  mysqli_real_connect($this->dbh, $host, $this->dbuser, $this->dbpassword,
      null, $port, $socket, $client_flags);
} else {
  @mysqli_real_connect($this->dbh, $host, $this->dbuser, $this->dbpassword,
      null, $port, $socket, $client_flags);
}

As best I can tell, this code leads to a non-critical DNS lookup error on the App Engine environment that doesn’t affect the running site directly. However it does output some extra junk onto the page before the rest of the page has loaded. This prevents WordPress from setting cookies which breaks logins. The error looks like a forgotten password problem, but it isn’t.

WordPress updates are likely to be a little more/less painful since I can’t run them from WordPress itself since the file system is read only. Instead I need to use the WordPress cli locally and update with:

gcloud app deploy --promote --stop-previous-version app.yaml cron.yaml

I need to figure out if I can download my whole WordPress install from the cloud or if I have to copy it from one machine to the next. On the plus side, that is considerably more secure than a classic WordPress install that expects to write directly into the file system. I definitely had some problems with that on the old host.

I also need to run this for a month and see what sort of costs it incurs. pair.com cost me $17.95 a month which covered four sites. However HTTPS would have cost me a lot more, and they were never very helpful when I tried to set that up.

Although the initial migration preserved all my images, they now appear to have vanished. I suspect turning on one of the App Engine WordPress plugins makes WordPress look for them in Google Cloud Storage instead of the file system. Hmm, looks like the problem is that the images are all pointing to the old site at URLs like http://cafe.elharo.com/wp-content/uploads/2016/02/noservertypedefinition.png instead of with relative URLs. That’s weird. In any case, should be fixed now.

If you notice any remaining problems, please leave a comment. (Assuming comments work. I haven’t tested that yet.)

Once I’ve got the bugs worked out of this site, I’ll try to move Mokka mit Schlag over as well. That’s going to be trickier though because www.elharo.com is a mix of WordPress and classic static HTML. I need to figure out if App Engine Standard can handle that, or if I’ll need to move to something more complex like GCE.

One Response to “Now on App Engine Standard”

  1. Elliotte Rusty Harold Says:

    If you see a comment here, then that means that comments are working. OTOH I do seem to have lost the live comment preview I had on the old site. Have to figure out if I can restore that.

Leave a Reply