Pages

Thursday, November 20, 2008

Restoring MOSS backup - Nightmare

I am currently trying to restore a backup which was created in the dev environment (using Sharepoint Central Adminstration) into the staging environment. The dev environment is totally isolated from the staging environment i.e., two separate physical locations with separate AD.

When I tried to restore the first error was Access to the path '\\server\webbak\spbrtoc.xml' is denied. Tried giving access to everyone to the path but no luck. You need to specifically give access to the user account under which SQL Server runs! 

Phew! I thougt I am through. Actually not! Now that I managed to get past this error, I continued to the restoration process. This time the restoration job gives an error Message: Cannot open database "DatabaseName" requested by the login. The login failed. Login failed for user 'Domain\DBUser'. The funny part was the IIS site was created. The web application is listed on SharePoint and the database also got created! Well after spending hours of googling without any luck I went back to basics and identified the permissions for DBUser on the newly created database. Even though DBUser was the user which created the Database, DBUser did not have permissions to look at the tables. 

So, I now have a situation where everything gets created but fails in the end. As though it was not challenging enough I do not have have the source code with me!!! Ok, now for the solution (or rather start of the solution). I once again ran the restore (you need to delete the entry in timer job) before restarting the restore. Now, I kept refreshing the DB List on management studio while the restore job was running.  As soon as saw my DB Name on the list I immediately clicked (pounced) on new query and ran this command - sp_changedbowner "Domain\DBUser". Now, DBUser became the owner of the newly created database and hence the restore went through!

Wow! I jumped in joy only to realise that even though the job was successful when I tried to browse to the URL I got the usual 404-Page not found error. Back to work - I figured out this happened because the site collection did not get created. I went to the managed Content databases on the Central Administration Screen and found that the number of sites on for the DB was 0! Not to be disheartend got back to work (rather guessing this time).  Here are the final steps which got the site up

1) I removed the content db from the web app

2) Detached it from SQL Server

3) Attached it back to SQL Server

3) Attached the content DB back to the web app (using Central Administration).

Restarted the site through IIS. For once I was lucky since I have no clue why this worked but after so much hassle hey who cares, it worked!



Monday, November 17, 2008

Indians driving in the US

For the brave hearted who are going to rent a car for the first time in the US here are a few tips. I am writing this from the experiences I have had.

If you have driven automatics you can skip this paragraph. Even before you can shift to drive (D) or Reverse (R). You need to push the brake pedal else you will not be able to shift to drive or reverse. This should help you avoid fighting with the lever.

We drive on the left side of the road it is quite difficult to remember to stay on the right especially when the road is empty. So, for the first few days keep this in mind.

At the traffic light you can turn right on red unless there is a sign which says "No turn on Red". Ofcourse before you turn on red, you need to look around to ensure no one is heading your way. If you are turning left then wait for the green left arrow. Or if there is a green signal only (for straight traffic), wait for all oncoming traffic to pass and then take a left.

When a road has many lanes, it is not necessary that the lanes are equally distributed. For example - a road may have 4 lanes : 3 for oncoming traffic and 1 for you! In case there are no dividers then there will be a thick yellow line to mark this. So, before you turn left or right have a look and then decide where you have to end up. This was very weird and I ended up almost driving on the wrong side of the road!

4 way stop signs - This is another interesting signal. You will see it as a 4 way stop sign or all way stop. This means the person reaching the stop sign first gets the right of way. In case, two drivers arrive at the stop sign at the same time the driver to the right gets the right of way - which is the opposite when you normally drive on the road where the driver to the left has the right of way.

Assuming you have successfully reached your destination, you now need to park and get down. You will not be able to remove the key unless the gear lever is in the Park (P) position. Hang on! you will not be able to move the gear to Park when the key is in the off position. So, make sure you move to park when the key is in the on position, switch off the engine and then you can get down!

Finally, if you are stopped by the cops do not get down till he/she asks you to. Keep your hands on the steering wheel, lower the window and then follow instructions - this is not through experience but hearsay! Drive Safe!

Vegetarians travelling to US

Though I am a non-vegetarian, this article will be useful to all vegetarians. I have travelled to the US quite frequently and I thought I will share my experiences on how I survived with minimum cooking. This will particularly be useful to those who are unable to find decent vegetarian food outside.

You do get frozen paratas, chappatis and oothappams but the challenge is to get a dish to go with it. I had tried out the Frozen Indian foods (microwavable). They give a strong masala smell and it is quite pungent and difficult to eat on a daily basis. So, here are a few tips. Get the following ingredents (all inexpensive) - tawa (for heating chappatis), cooking oil (vegetable oil), a metal ice cream scoop with a thick plastic handle (available at the dollar store), mustard and cummin seed. After heating the frozen foods in the microwave. Heat the oil for about 3 mins in the ice cream scoop, then add a few mustard seeds and some cummin seeds, mix it with the microwaved food and you have delicious smelling food. Deep foods' Mirchi Masala is one of my favourite brands. No! I am not being paid to write this article.

Monday, August 25, 2008

Custom .Net application on SharePoint

Following are the few points I would suggest considering when deciding whether to use MOSS as the platform for the application you develop.

1) Is your application centered on Documents?
2) Is your application looking for collaboration features like blog, Wiki, Tasks etc?
3) Is your application about managing the web content and require content authoring, review process to publish the content to web?
4) Is your application looking at managing a unstructured content?
5) Is your application looking managing site strcture (Site-->sub site)?
6) Is your application looking at using Out-of-the Box User Management, Access Control?

If your answer is yes to any of the above questions then you can consider SharePoint.


Also MOSS is not a recommended plaform if you are looking at building
1) Transaction based application which would require use of a Custom database
2) Application as a Front end that leverages all of it features through external systems and nothing from MOSS features

Wednesday, July 30, 2008

Applying SP2 to SQL Server 2005

One would have thought that applying a Service Pack is an easy job. Well not exactly as I found out. I spend two days trying to apply the patch. 

The main problem as I noticed from the log was that the installer was looking for a .msp file which did not exist.


Solution

Uninstall SQL Server completely using the Windows Installer Cleanup utility - http://support.microsoft.com/KB/290301.

Once all the components of SQL Server have been uninstalled. Install SQL Server from the original source - could be the DVD or the downloaded software. During installation you may get an error about owc11.exe. Uninstallation of this is not possible through the Add/Remove programs in Control Panel. This will have to be uninstalled by using the Windows Installer Cleanup utility. Once this is done re-run SQL Server 2005 setup and it should go through.

After installing SQL Server, install SP2. Hurrah! I had my SQL Server up and running and what was surprising was I found all the databases intact. Obviously, it is still a good idea to backup your databases before trying this out.