Fixing wordpress

I’ve just spent some time fixing wordpress after a system update and a VM migration (yeah, always snapshot first, lesson learnt).

“error establishing a database connection”: after importing the database and copying the wordpress files, there is a mismatch between the password from the wordpress config and the one set during the container installation. Make sure the password in the db matches the one for DB_PASSWORD in wp-config.php.

The DNS updates takes a long time (read hours). And while it’s updating you may have all sorts of funny effects randomly switching from one machine to the other. To track the progress:

watch -n 1 nslookup www.mycooldomainname.com

Then the pretty url stopped working, returning “The requested URL /xyz/ was not found on this server.”. Somehow the .htaccess disappeared in the wordpress directory (it was not included in the tar backup for the VM migration, but I suspect something went on during the system update before…). To easily recreate, access the wordpress admin interface, go to Settings, Permalinks. Select “Plain” and “Save change” (that recreate the .htaccess) and then select whatever you want for the link and save again.

Leave a Reply

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