August 30th, 2007

Think. (And manage risks by creating backups)

It seems that this is your first time to my blog. Welcome! In this blog I will share my ideas on how you can make a living in a way that feels good to you, your family, your environment and everyone around you. If you want to know more about me and this blog, check out my about page. And if you want to stay updated on my new posts, subscribe to my RSS feed. Thanks for stopping by!

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!

If you enjoyed this post and don't want to miss any of my new content, subscribe to my RSS feed or have the latest posts delivered straight to your e-mail inbox.

3 Responses to “Think. (And manage risks by creating backups)”

  • Petteri Hietavirta Says:

    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.

  • Jarkko Says:

    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.

  • Jarkko Says:

    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 :)

Leave a Reply