[thelist] backing up your databases, just in case

Sarah poohbear at designshift.com
Tue Aug 12 09:17:39 CDT 2003

Hello, all!

It's good to be back on thelist - I had suspended message delivery for 
almost two weeks while I dealt with a *stupid* mistake I made. Here is the 
gist of what happened...

I'm working on a large site for a client, a redevelopment/merging of two 
sites they currently have. The site has categories, which hold "documents", 
which hold files and URLs. I had written some nifty ColdFusion to import 
the data from the old sites into the new site, including some loops to go 
through and update foreign keys (since the old database tables would have 
had duplicate IDs, I had to create new IDs). Anyway, everything was going 
great, the client was using the preview of the site to reorganize the data 
before launching the site. Then I decided to import one last small batch of 
documents... I thought to myself, "maybe I should do a dump of the MySQL 
database first, just in case..." But my password to SSH to MySQL wasn't 
working - and the network admin was at home, moving - and I didn't want to 
bug him (stupid, stupid, stupid). Anyway, I ran the data import script, the 
data got royally screwed up, and I didn't have a back up. The network admin 
came in the next day and proceeded to try to get the database restored from 
our nightly backups, but, wouldn't you know, the backup from before I 
screwed up the database had been overwritten by the previous night's 
backup. As it turns out, about 950 records in the database, from two 
different tables, had their foreign keys blasted away. I had to go through 
by hand and fix them all. I ran into some lucky breaks which sped up some 
of the process, and there are now only about 100 records left to fix, which 
I am doing with the client's help. And the moral of the story, boys and 
girls? When in doubt, backup your database, JUST IN CASE! I am such a dork...


More information about the thelist mailing list