Remember Kids, Backups Are Important

On Saturday night I decided to update my Drupal install and ran into some issues, which has meant some additional learning and rebuilding before I can get it back online. Every time you update either Drupal core or it's modules it's a good idea to manually run cron as some updates need to make changes to the database schema. I did this and had to learn some lessons the hard way.

My web host has a PHP limit of 16mb which is not so much of a problem, although not ideal. I assumed I couldn't do anything to increase it so I ignored it until the Drupal database updating procedure freaked out trying to execute a 16.4mb process and running out of RAM to complete the shema update. The result was an unrecoverable database error. This was the point where I thought it'd be a great idea to back up the database and restore it. The eagle eye'd among you will spot the problem.

Remember kids, backups are useful if you do them before you run into problems, and back them up in a functional state.

My partial Drupal admin areaThe result was that I had a partial admin area to work from, and had to rebuild this site in a different directory, then bring it back across. Luckily all of my actual content was still there, albeit plenty of Drupal functions were missing and I had to do things the long way, by copying and pasting each blog entry, matching the post date and time etc, as well as the comments. Anyone familiar with the admin area of Drupal will spot LOTS of missing stuff.

At this point I started to wonder how I was going to fix this, and more importantly how I was going to update if the 16mb PHP limit was going to give me the same errors next time. I looked around and found that it's possible to have a php.ini file inside the directory the php script is in that overrides the server default, so I can increase the limit. I'd never have known this if these issues had not cropped up.

It's also gave me a reminder of how important regular backups are. A few years ago I lost around 5gb of personal files when my XP desktop ran it's WGA  (Windows Genuine Advantage) check and wrongly picked my install up as illegal. Windows started shutting down random files and services to the point where I couldn't even get in to back my stuff up. My only choice was to wipe it and reinstall XP. Since then I've hated the WGA with a passion, always disabled the automatic updates in Windows and deselected the WGA when it's offered.

This was long before I'd heard of Linux, but I was on dial up so it took me a long time to fill that 5gb and I lost the lot. It seems that lesson has been lost on me, and I had to be taught again. At least this time I didn't lose anything other than a couple of days extra hassle to rebuild the site.

The site may be a little different from before. I've taken the opportunity to play about a little with it. I now have an archives section for all of my older blog entries. I've also switched to Mollom for the anti-spam / CAPTCHA services. I noted that the other CAPTCHA module I was using was trying to update it's schema which helped contribute to the 16+mb process. Mollom seems to be a better approach anyway, and the preferred method.

Tags: 

If you liked this post, buy me a coffee

Comments

Yes! And there still are people who don't think so. I'm sure that mostly noone remember to save their work regulary. Having the original file with several copies will help you much to save time, efforts and very often money. Especially if you need to go back to an older version of a file. You should always have some plan B for different unpredictable situations.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <p> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer