Tuesday, August 30, 2005

A disaster recovery movie...

Woked up alive from one of my worst sharepoint nightmares ever...

Thank god it is over. Took me 3 days in research trial-error.

My Sharepoint server burned (literally).The HDD's were recovered, so I was able to get the mdf files, thanks to our system admin. What would we do without him ?

I attached the mdf's to a new SQL server database, set up a new WSS site (SP1), and tried to use my existing content and database server (as every logical IT person would do).

But life was never that easy... Ever.

"The database schema is too old to perform this operation in this SharePoint cluster. Please upgrade the database and try again. " Said the holy WSS...

So, as a logical IT person, I tried to find the nice MS WSS utility to upgrade my database :) lol One would think that would exist, right ? Think again...

Basically I was trying to use both the content and the configuration database files (mdf files) of WSS on a virtual server "MyWSS" that used to run on a physical server called "MyServer", on a new physical server "MyServer2" with the same virtual server name... Of course, the physical database server needed to be changed as well.

Besides the version conflicts, it sounded like a disaster recovery that is almost identical to "the disaster recovery for the company WSS on Small Business Server", and actually the resources on that subject helped me quite a bit.

I ended up exploring the Configuration database tables with MsAccess, and replacing version numbers, server names, IP addresses, modifying the references in XML property columns e.t.c. directly in the database. Brutally...

:)

But worked.

I got it up and running except for a few image files... It is a shame that sharepoint images, templates and WebParts (Yes, they seem to reside in the database, but it didn't work, i had to re-install them) are still in the file system...

OH, and by the way, I did compare the database structure of both versions...
The only difference was that : In "Docs" table, a calculated "Extension" column was added in version 6.0.2.6411... So much for 3 days, a stupid "Alter table" statement should do the job...

What I did in a little more detail is:

Our system admin upgraded the WSS with the latest and greatest from MS.
I used a new configuration database, extended a new virtual server with the same name as my poor old blown WSS with a new content database...
I explored my old configuration database in my good ol' friend MsAccess.
I added my new SQL server to the servers table.
I replaced the serverID in the services table to reference the new SQL server.
I replaced my old physical server name to my new server name in the configuration database.
Then I changed my configuration database to my old (and purified :)) database in Central edministration.
IISreset
Expected it to work huh ? :) not yet...
Removed (without removing the content database) and re-extended my virtual server.
IISreset.
I got it up and running without the webparts at that point.
Then installed my web part installation cabinet files. (What an organized operson I am, I had all of them in one single folder)
A last IISReset, just in case, and after that fully functional, except that company logo and my "trans.gif" images missing.

Do not try unless you have to, and if you do so, do it at your own risk...

See you on another adventure.