Updating WordPress Was A Mistake, Redux

This week, I have been plagued by WordPress; the website I made for my volunteer service keeps crashing because MariaDB is having out-of-memory problems. This is frustrating because it ran fine for five months. But suddenly, the site cannot go three hours before going down. Sigh.

However, I had run the site with the latest version of WordPress. From this post, I had talked about previously needing to downgrade to keep my personal website (this page you are reading) from crashing. I said it was easy, but I didn’t outline the steps.

Well, with the volunteer service website crashing constantly, I’m trying this downgrade again.

Here are the steps:

  1. Make a backup of the server.
  2. Get a copy of wordpress-6.5.5.tar.gz and copy it to the server.
  3. extract it with tar -xzf wordpress-6.5.5.tar.gz
  4. change directory into the extracted folder
  5. delete the file wp-config-sample.php
  6. copy the production wp-config.php from /var/www/html (or wherever) to the newly extracted folder1
  7. (Still within the extracted folder of the downloaded WordPress 6.5.5): delete the wp-content folder.
    • This is one of the good things about WordPress: everything that is not stored in the database is stored here. This includes the uploads folder (the media library content), the themes, the plugins. So for the source we’re going to downgrade from, we don’t need this folder.
  8. change directory to /var/www/html (or wherever)
  9. rm -r wp-includes
  10. rm -r wp-admin
    • wp-includes is where most of the WordPress code lives. But there is also WordPress code in wp-admin
    • Production is now broken
  11. cp -r /wherever_you_downloaded_and_extracted_to/wordpress/* /var/www/html/wherever/
  12. chown -R www-data:www-data /var/www/html/wherever/
  13. find /var/www/html/wherever/ -type d -exec chmod 755 {} \;
  14. find /var/www/html/wherever/ -type f -exec chmod 644 {} \;
  15. systemctl restart apache2
    • Production is back up, but there’s still another step
  16. Log in to the WordPress website as admin. It will prompt you to update the database. Yes, do that.

And my downgrade, which is an improvement over having the bloated React JSX stuff, is complete.

Well, there’s one more step: email the office manager that when she logs in to WordPress to add a post or a meeting or event or whatever, do not click this link:

That’s always nice: leaving an easy way to shoot one’s self in the foot just sitting there, begging to be clicked. Sigh.

  1. I always liked that SuSE put the web server web sites under /srv instead of /var – there’s a lot of weird stuff in /var but for a web server, having the web site under /srv/www just makes sense. And yes, if you are setting up an FTP server, all that goes under /srv/ftp. What a concept! ↩︎