That’s the last time I trust Ubuntu to upgrade correctly

I host Barcamp Chicago’s website.  It’s a custom Django site on Ubuntu.  I recently upgraded the server to the latest LTS and later discovered my Postgresql database was gone.  Postgresql had gone from 8.3 to 8.4 in the upgrade, but since it didn’t warn me about needing to migrate the data I assumed it took care of that.  That was a mistake.  I had three databases on Postgresql 8.3 and none of them were present anymore.  I read on a forum that I could reinstall 8.3, but that person was working from Karmic not Lucid like I had.  I ultimately had to:

  1. add the Karmic repositories to apt,
  2. shut down 8.4,
  3. install 8.3,
  4. go through the normal data dump procedure for upgrading Postgresql manually,
  5. uninstall 8.3,
  6. start 8.4,
  7. and load all the data again.

After that the CLI showed my databases were present so I relaunched the barcamp site, but it still wasn’t connecting.  A little more googling revealed that Postgresql likes to increment the port number it listens on when there are two versions installed on the same machine.  That was indeed the problem, so I changed the port number back, restarted it and Apache, and finally I’m back to where I started.

I should have known better than to trust Ubuntu to migrate the data, but even if I did that myself I’d never expect a minor version upgrade to listen on a different port when that upgrade disables the old version anyway.

Using Screen for Unreliable Connections

The other day I was working in a coffee shop and their internet connection went down a couple times. Unfortunately, I was ssh’ed into another box where my work was. Fortunately, I was using screen. I figured my session would disconnect and be sitting there ready for me to reconnect when the link came back up. Sure enough, it was. Saved me a lot of hassle reopening my files and saving more frequently. Here’s the article that describes how to reconnect to a lost screen session after your ssh session times out (not that it’s that difficult, but I’m sure I’ll forget and have to reference this).