Hi. I've got a WordPress site configured with EasyEngine 4, and I'd like to migrate it to WordOps. I've followed all the steps from the guide and there is some problem. I can see a raw version of the homepage (no theme applied) but it doesn't load any posts, and I can't login.

The error shown on the error.log is as follows

2020/03/15 20:23:11 [error] 37498#37498: *26784 FastCGI sent in stderr: "PHP message: PHP Warning: Redis::connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/site.com/htdocs/wp-content/plugins/nginx-helper/admin/class-phpredis-purger.php on line 45" while reading response header from upstream, client: 83.33.214.99, server: site.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php72-two-fpm.sock:", host: "site.com"

I think maybe I have a different PHP version in the two sites but in the source I've got PHP 7.2.26 and on the destination (WordOps) I've got 7.2.28, so that shouldn't be a problem. I guess it has something to do with the Redis configuration on the source and the destination. I wonder if maybe disabling redis at the source and starting the process from zero could work.

  • The "gotcha" I ran into was SSL.

    You can self-sign via command line, or do what I did for most of my migrations.

    define WP_SITEURL and WP_HOME as http://domain.com in the wp-config.php so it doesn't scream at you about SSL validation.

    I use Cloudflare for SSL termination, so I don't have to worry about any SSL within my WordOps configuration (we have a cluster of servers running on WordOps)

The error suggests redis can't be found (is it running?) - what do you get if you run sudo systemctl status redis

It seems to be working. This is what I get after running that command:

● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2020-03-15 13:03:47 CET; 22h ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 37342 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 37346 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/SUCCESS)
Main PID: 37348 (redis-server)
Tasks: 4 (limit: 2353)
CGroup: /system.slice/redis-server.service
└─37348 /usr/bin/redis-server 127.0.0.1:6379

Yup, looks to be running OK.

Check sudo wo site info yourdomain.com to make sure it says:-

Nginx configuration             wp wpredis (enabled)

If that's OK, you can try the more obvious stuff:-

  • clear the cache sudo wo clean --redis
  • restart redis sudo systemctl restart redis
  • restart the server

If none of that helps, then you could try removing redis caching for the site (just to see if that at least gets the site up and running):-
sudo wo site update yourdomain.com --wp
Switching back to redis caching would then be:-
sudo wo site update yourdomain.com --wpredis

Thanks for the suggestions Marty, I really appreciate your help. Unfortunately none of them work. I've reloaded the site (cleaning my browser cache) after every step without success. After disabling redis the raw home page that at least showed up doesn't show now. Same happens after enabling it again.

I think the problem lies in the database dump I make from the original site. Maybe the redis configuration, or cache, or some component that is linked with EasyEngine v4 there (4.0.12) makes everything fail.

I'm thinking about restarting the migration process but instead of doing a mysqldump and mysql restore on destination trying to use some kind of plugin to do the database migration and see what happens.

A migration via plugin is a good idea. That's how I migrate all my sites between servers.

I prefer UpDraft Plus. It's free and does a great job.

    The "gotcha" I ran into was SSL.

    You can self-sign via command line, or do what I did for most of my migrations.

    define WP_SITEURL and WP_HOME as http://domain.com in the wp-config.php so it doesn't scream at you about SSL validation.

    I use Cloudflare for SSL termination, so I don't have to worry about any SSL within my WordOps configuration (we have a cluster of servers running on WordOps)

      Is there anything else in the error logs? (Particularly for when redis caching is disabled for the site)

      I don't really know ee v4, but I'd be surprised if there was anything at the WP or DB level specific to v4. But if there is, a plugin migration may just put you in the same position anyway (worth a shot though as it rules out a bunch stuff).

      It may also be worth checking dev tools in your web browser (usually F12 key) to see what resources are not loading properly. And what urls they are being loaded from (e.g. is there a subdomain or CDN involved?)

        jond1 Updating the site and adding the Let's Encrypt (LE) certificate is something I already though of, but I didn't think of modifying the DB and those two values, could be a possibility. Anyway, I'm not sure that's the problem as the site should show some kind of wanking in the browser about not having a valid certificate, right? Anyway I'll keep an eye on that. With EasyEngine v4 I just used the update option for adding LE and it worked pretty nicely.

        marty I'm starting to realize that that's the problem. Something on ee v4 (something around Redis, I guess) is messing with the database, because I've tried UdraftPlus as @jond1 suggested and after restoring the site, I got the exact same result: the home page loads without CSS styles, but I can't access the admin dashboard or any other single post at all.

        I've tried other WP Backup plugins (All-in-one WP Migration, BackWPUp) without luck, so I'll probably will try first the http:// replaces and will analyze also the site with dev options (no CDN or subdomains involved), thanks for the ideas.

        The blog is pretty large right now. I started it in 2005 and has over 3,200 posts and a couple thousand images (the htdocs folder is around 2,5 GB , the database dump is currently at 60 MB) in case this gives more insight into the problem.

        BTW: After doing the 'wo stack install' the WordOps dashboard is installed at port 22222, but I didn't catch the username and password and don't know how to recover them. This could be useful for me to access phpmyadmin or adminer in case I try to import just the DB from there instead or by command line or plugin. Can you help on this?

          Good news! It seems that the WP_SITEURL and WP_HOME trick works indeed! I just changed that through the wp-config.php file, dump the database, import it in the new VPS, change there as well the wp-config.php to include those two defines (define( 'WP_HOME', 'https://example.com' ); and define( 'WP_SITEURL', 'https://example.com' );) and I'm scp'ing and slowly enabling plugins, themes and uploads from one side to the other.

          I think it's finally solved, I'll update this as soon as I get everything fixed. Thanks again for your help and cross fingers!

          Edit: it seems to have worked, the site is now working from the new VPS, DNS registry updated, so it's up and running 🙂

          Thank you !!

          javipas WordOps dashboard is installed at port 22222, but I didn't catch the username and password and don't know how to recover them

          Just do wo secure --auth to change it (mentioned here).
          You can also whitelist IP's so you don't need to login at all (details at the same link).

            marty Great, thanks for the tip and the link Marty.

            Hosted by VirtuBox