Raspberry Pi WordPress Crash

For the third or fourth time in the last two years (or so), my Raspberry Pi WordPress installation has crashed.  Once I was able to fix relatively quickly, with little or no data loss.  The others… not so much.

I even had a full backup on my latest installation… I thought.  Trying to use that backup to restore (an admittedly wounded installation) completely crashed it.  Not sure I want to try again… but certainly looking at alternative means going forward.

This time, the “fix” was to completely re-install MySQL, create a new WordPress database, and a completely fresh WordPress install.  Need to make more notes of this to follow next time (and to store in something other than just the affected WordPress blog!).

And generally need to do a better job documenting my linux commands, probably both here, and elsewhere.

Re-install MySQL

sudo apt-get remove --purge mysql*
sudo mv /var/lib/mysql /var/lib/mysql_backup
sudo mv /etc/mysql /etc/mysql_backup
sudo apt-get install mysql-server

Re-install WordPress

cd /srv/www/wordpress
sudo mv public_html/ backup/
sudo wget https://wordpress.org/latest.tar.gz
sudo tar -xvf latest.tar.gz
sudo mv wordpress/ public_html/
cd public_html
sudo nano wp-config-sample.php (configure database, username and password; save as wp-config.php)
sudo chown -R www-data:www-data /srv/www/wordpress/public_html

Posted

in

by

Comments

One response to “Raspberry Pi WordPress Crash”

  1. Rob Klingler Avatar
    Rob Klingler

    Restored 80% of content (minus one post I no longer liked) by digging around a MySQL dump that had been saved. Lost my latest draft post… which might have been the one I was most excited about, but pretty good recovery!

Leave a Reply

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