Ready to Quit (Again!) after my Laptop Computer Crashed
Last Monday, May 8, my laptop computer crashed. I suddenly couldn’t get into any of the directories other than the root directory. I wanted to quit again (like last time) but I didn’t.
My WordPress database is the last thing I restored – today. I restored everything else days ago. The database took most of this week because none of my backups were any good. For whatever reason, they were truncated at 20 bytes.
Ready to Quit
I went through several stages before I decided to restore the database from static files. Depression and acceptance were the important ones. I want to quit when I’m ready to quit and not before.
One day, I’ll quit doing this for sure. It may be the day I die, when it’s guaranteed I will. I hope that day doesn’t come for a long, long time.
The Database Backup
My laptop computer stays on 24 hours a day. I only reboot it when I’m upgrading the kernel. The last time I checked, the file sizes looked right, but that was about a month ago.
Each backup (and I keep several days on the drive) is merely a MySQL dump (MariaDB actually) and I still can’t figure out why the files were truncated. I ran the backup script today, after I finished restoring everything, and it worked fine.
To be fair to myself, this is the first time I’ve lost a database in 18 years.
WordPress and PHP Programming Magic
I wrote a long PHP script and used WordPress functions to build (not restore) the database. These were the most important functions:
With the wp_insert_post function, I needed an array of category IDs. I didn’t need an array of tag IDs, but that’s what I fed it anyway.
Only a few things didn’t get added to the database automatically and I don’t know why. It was easier to spend a couple of hours doing it manually than waiting for the script to run again. The contact page iframe was whacked and none of the YouTube embeds came through. 15 tags didn’t make it and it was easy enough to find which posts they belonged to.
The hardest part was writing the script to parse the static files. I don’t want to ever have to do it again. Maybe I should do manual backups from here on out.