Lessons learned.

So…somebody I know was having problems with their netbook running Ubuntu.

The somebody in question decided (for good and sufficient reasons) that part of the problem might be due to them having done several upgrade installs of recent Ubuntu versions which left cruft on the system. This somebody thought the best thing to do was to make a backup of /home, reformat the box, and reinstall Ubuntu 12.04 from scratch, blowing away all the existing data and partitions.

Which they did.

The somebody in question had a MySQL database on the box that had somewhere around ~2,500 records in it. It was a fairly simple database, probably overkill for MySQL: one table, a few columns.

It turns out that MySQL doesn’t store databases in /home. MySQL stores databases in /var/lib/mysql by default, and the somebody in question never changed the default. (This vaguely makes sense if you think about it; after all, MySQL is intended to be a multi-user database, so why would you store databases under an individual user’s home directory by default?)

The somebody in question found this out after blowing everything away. And, of course, the somebody in question only backed up /home.

Fortunately, the database isn’t that important, and much of the data on it can be recovered from older .CSV files that were used to import the data into MySQL.

But next time, the somebody in question is going to backup every damn thing, not just /home.

The somebody in question is also going to try to get out of the habit of making assumptions about where things are stored.

5 Responses to “Lessons learned.”

  1. Is there a chance the somebody in question will learn to use first-person pronouns?

  2. Borepatch says:

    Application data that’s not stored in /home or in /usr/local is anti-social

  3. stainles says:

    I didn’t back up /usr/local, either.

    Good thing to have learned this on a system that doesn’t matter all that much, rather than, you know, a customer system or something.

    Note the rich irony of the backup guy hosing himself by not doing backups right.

    (In deference to Lawrence, I’m switching to first person for now. But I am so going to do a blog post in the second person sometime soon.)

    (“You are not the kind of guy who ordinarily blogs stuff like this.”)

  4. Joe D says:

    You should look into SQLite for small database stuff like that.

    It’s not a client-server database. It’s a database engine that you link into your programs, but there is a command shell program. It’s ACID compliant, and understands standard SQL.

    It’s used all over the place. Chances are you’ve already got it. I use it for all kinds of stuff.

    http://www.sqlite.org/

  5. stainles says:

    Yeah, I believe I installed SQLite over the weekend as part of a vain attempt to get aircrack-ng working on Ubuntu. But that’s another story.

    I have looked at it, and have a project that will probably end up using it; SQLite is very handy for small devices, too.

    I wanted to use MySQL for this other project for various reasons, including gaining some familiarity with how it works; I already have some experience with SQL Server, so I thought knowing a bit about MySQL might be useful.