Think. (And manage risks by creating backups)

by Jarkko on August 30, 2007 · 3 comments

istock_000003841635xsmall.jpg

Yesterday I almost got a heart attack.

I have been working on a simple Facebook application for a few days using Ruby on Rails and RFacebook. Yesterday I got to the point that if I wanted to continue developing the application I had to deploy my server code to an online server.

I have some hosting space at Site5 that runs Rails. So no problem, I thought. I just get Capistrano running and deploy the application.

Not a bad idea. The only problem was that I forgot to think.

This blog runs on the same server.

I concentrated all my efforts in getting the automatic deployment tool Capistrano running. And after an hour or so it finally ran fine and the application was deployed.

Cool!

But when the application had been deployed, Capistrano deleted my existing public_html directory and created a symbolic link pointing to my simple Facebook app instead.

Not cool.

During the entire time I spent setting up Capistrano I didn’t pay any thoughts to what would happen at the end of the process. I just wanted to move forward one step at the time. I forgot to think.

Lesson 1:

Don’t forget to think. When you’re following a tutorial or other kinds of instructions, make sure you know what you’re doing. Don’t just mindlessly follow the steps one by one.

Lesson 2:

When deploying with Capistrano, the default setup assumes that you want to have your domain’s root folder point to the Rails application. I don’t know how to change this yet, so if there is a friendly Rails developer reading this post, some tips would be appreciated.

After my initial shock I started to breathe again. Slowly my heart rate came down to the normal 60-100 bpm.

How do I get the blog back up?

Do I have backups?

As I was thinking about these questions my heart rate started climbing up again: I didn’t have that many backups. All I had was the database (which was great because now all my articles were intact), and some old version of the design.

I installed WordPress again. Uploaded the old design.

It looked like crap, but the blog was online again. I knew I could fix it.

Few hours later the blog was working again. Some images are still missing but otherwise everything seems to be fine. I was lucky to have at least some backups – and all the posts in a database. If you notice that something is still not working, let me know and I’ll fix it as soon as possible.

Lesson 3:

Always create backups. Anything can happen, so you need to manage the risks.

Lesson 4:

Don’t panic.

If you have similar stories that you’d like to share, the comments section is all yours. Let’s learn from each other’s mistakes!

Dig Deeper!

Subscribe to the "Live Like You Mean It" newsletter for free to get one exclusive newsletter-only article on creating a sustainable, meaningful living every week, and occasional special offers from my blog. Just fill in the form below and click submit.

* Email
* First Name
 Last Name
  * = Required Field
 

{ 3 comments… read them below or add one }

Petteri Hietavirta August 30, 2007 at 3:38 pm

Such events are educating (if you survive them) as they remind mortality and dangers of using scripts made by somebody else…

Have you checked whether downtime affected your SEO rankings and similar? My site was once down several days due hosting provider’s hardware problems and it took some time to get traffic level back.

Reply

Jarkko August 30, 2007 at 8:26 pm

Yep. The next time I know to be more careful. Now I’m kind of scared to try the deployment again, but maybe if I have time I’ll continue with it on Saturday. Let’s see how the blog survives. :)

I haven’t checked my SEO rankings yet. It was only a few hours, but I’ll have to check.

Reply

Jarkko September 1, 2007 at 12:40 pm

Hah.. I was wondering why my visitor count had gone down to zero in Google Analytics – until I realized that I had lost my tracking code in this adventure :)

Reply

Leave a Comment

Previous post:

Next post: