How the IIS SEO Toolkit Saved My Butt

personal, code 0 comments suggest edit

Ok, it wasn’t necessarily my ass that was saved, but it was years worth of images which were important to me!

As I wrote yesterday, my blog’s hosting server had a hard-drive failure effectively wiping out my virtual machine, taking my blog down with it. Fortunately, I was able to get back up with a static archive of my site provided by Rich Skrenta, but I was missing all my images and other content (code samples).

As Jeff mentions,

I have learned the hard way that there are almost no organizations spidering and storing images on the web.

Keep in mind that the images are not just mere eye candy. In many cases, they serve to illustrate key concepts: “As you can see in the screenshot above, if the screenshot were still to exist, but through the sheer ineptitude of Phil you’ll have to guess at the knowledge it would have conveyed.

As I was lamenting the loss of these files, I started poking around my browser cache (finding this great tool for exporting the Google Chrome cache by the way which can retain directory structure) looking for stray images.

I then started thinking about alternative tools that might cache web content such as a client RSS reader, etc. Then it occurred to me, didn’t I run the IIS SEO Toolkit against my site recently (click to enlarge)?

SEO Toolkit
ScreenshotThe first time I saw the SEO Toolkit was when Carlos Aguilar gave me a demo a long while ago. Back then it was just something he put together over the weekend. As soon as I saw it I begged him (quite annoyingly I must say) to let me have a private build to try out. Eventually it was released and I was able to run it against to see how much I sucked.

Well it’s a good thing I ran it back in August! This tool stores a local cache of images. Oddly enough, it appends a .txt extension to every cached file.

cached-images No worries! Using a bit of DOS command magic, I was able to strip off the .txt extension from every file (note I ran this from the command line. If you put this in a batch file, you’ll need to double up on the % character).

for /r %x in (*.c) do ren “%x” “%~nx”

That stripped off the extensions. Afterwards I uploaded the images and am now only missing images for 18 blog posts, the posts written in August, September, and October of 2009. Those shouldn’t be too hard to recreate manually (though if you happen to have those images in your browser or RSS cache, I do appreciate you sending them to me! My email at Microsoft is philha)

Looks like I caught a lucky break this time in finding and leveraging the previously undocumented “Back up a website for dummies” feature in the IIS SEO Toolkit. Carlos, I owe you one! :)

UPDATE: If you were wondering why the cached files were stored with a .txt extension appended, Carlos revealed the mystery to me in an email.

Oh I forgot to explain that silly thing we do with file extensions is a “naïve-silly attempt” to reduce the accident of double-clicking a javascript, exe, or let the shell try to display ‘malign image’ that might come from external sites. Since in theory we consider that a ‘private’ cache we decided to do this silly trick to prevent any funky games with somebody generating an ‘brittney-spears-nude-picture.jpg.exe’ with the icon of a JPG file that lured someone into running it.

Agreed its pretty silly, but it was a simple ‘cheesy security feature’ easy to add for our ‘hidden cache’.

Basically it helps protect the double-click happy folks out there from hurting themselves accidentally.

Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.



22 responses

  1. Avatar for Klaus Graefensteiner
    Klaus Graefensteiner December 14th, 2009

    Restoring a backup works as well.:-)

  2. Avatar for Ian Roke
    Ian Roke December 14th, 2009

    I am so glad you were able to restore your blog and being so open about what you have had to go through this past week.
    I am certainly more assiduous with my backup strategy thanks to the troubles you have gone through.

  3. Avatar for Andrei Ignat
    Andrei Ignat December 14th, 2009

    It's a imaginative use for IIS SEO Toolkit.
    But - did you think now about backup the data by ftp (such as, with filezilla command line ?)

  4. Avatar for DevCowbiy
    DevCowbiy December 14th, 2009

    The below does command would've word
    rename *.txt *.

  5. Avatar for Ruddy Santos
    Ruddy Santos December 14th, 2009

    Just sent you all the old postings I had
    from Outlook.

  6. Avatar for Steve Nutt
    Steve Nutt December 14th, 2009

    Great post but you did not include a link to the IIS SEO Toolkit - which interests me. Does it help you optimize pages that are protected by Forms Authentication ?

  7. Avatar for haacked
    haacked December 14th, 2009

    @DevCowBoy I didn't think that would work recursively.

  8. Avatar for haacked
    haacked December 14th, 2009

    @Steve Nutt, Doh! I updated the post with the link. I also added a bit more detail on why they append the .txt suffix.

  9. Avatar for CarlosAg
    CarlosAg December 14th, 2009

    Here is the link to get the SEO Toolkit in case you are interested:

  10. Avatar for Jonas Stawski
    Jonas Stawski December 14th, 2009

    "DOS Command magic"?!?!?!?! Dude, where's your Microsoft in you? You need to advocate PowerShell...

  11. Avatar for Matt
    Matt December 15th, 2009

    I have to agree with Jonas, I'm disappointed you didn't use powershell. DOS command windows are for losers.

  12. Avatar for Carlos
    Carlos December 15th, 2009

    I was going to suggest this:*/ but because of their updates policy the content is not going to be there YET.

  13. Avatar for wife
    wife December 15th, 2009

    THANK GOODNESS! It's been a bit tense on the home front these days! ; )

  14. Avatar for Gary Cox
    Gary Cox December 15th, 2009

    I would just like to regurgitate your header "You've been Haacked and you like it"!! A successful backup is a restoreable backup. Lessons learned and we all move on; hopefully not making that mistake again.

  15. Avatar for haacked
    haacked December 15th, 2009

    @Jonas ok, what's the command in Powershell then?

  16. Avatar for BCS
    BCS December 15th, 2009

    I seem to have some of the images in my FF cache. What's still missing?

  17. Avatar for haacked
    haacked December 15th, 2009

    @BCS Images from my posts in October.

  18. Avatar for rohn smith
    rohn smith December 15th, 2009

    Hi it is realy remarkeble moment for you so yo can get your blog back.

  19. Avatar for Mike Portson
    Mike Portson December 15th, 2009

    This SEO toolkit looks like something that really could be handy, but is it necessary? I have a problem with that - there are so many programs, tools, applications, add-ons etc, that sometimes I don't know what should I use and what shouldn't I use to make my web presence, my traffic and my earnings better.

  20. Avatar for double_deuce
    double_deuce December 15th, 2009

    wow, you should play lotto.
    I have had nightmares like this realizing that the ISP backups are as good as no backup since the formats are usually obscure or loose structure.

  21. Avatar for IT support kent
    IT support kent March 14th, 2010

    Thanks for providing such useful information. I really appreciate your professional approach.

  22. Avatar for Business Network Kent
    Business Network Kent March 14th, 2010

    Me and my friend were arguing about an issue similar to this! Now I know that I was right. ! Thanks for the information you post.