Wednesday, February 24, 2010

how to activate SharePoint Tool Basket Language files when using sptoolbasket from Codeplex

Simple yet tricky this little annoying thing when deploying the SPTOOLBASKET from Codeplex ( In order to activate the Document Ratings Feature, you need to activate prior the feature named "SharePoint Tool Basket Language files". But wait a minute this cannot be activated from Site Settings > Site Collection Features. You would need to do this for the Web Application via Central Administration > Manage Web Application Features (and select your web app). Simple as that but can be annoying to figure out especially if you are working on a project burning the midnight oil!

How to create a Windows Shell Right Click command to easily add your WSP to the Solution Store

How to create a Windows Shell Right Click command to easily add your WSP to the Solution Store.
Open regedit.exe and then make following changes in registry

Right Click on "HKEY_CLASSES_ROOT" and create a New Key called ".wsp" and set the value to "wspfile"

Right Click on HKEY_CLASSES_ROOT\wspfile and create a New Key called "shell"

Right Click on HKEY_CLASSES_ROOT\wspfile\shell and create a New Key called "Add Solution"

Right Click on HKEY_CLASSES_ROOT\wspfile\shell\Add Solution and create a New Key called "command" and set the value to "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o addsolution -filename "%1"

Note in all the above values, make sure you remove the first and last inverted commas on values

Now go back and open Windows Explorer and locate your WSP file on your file system. Right Click on that file with your mouse and EUREKA you will find "Add Solution" as a new Windows Shell command. Select this option to add the WSP to the MOSS Solution Store

Friday, February 19, 2010

Site collection could not be restored. If this problem persists, please make sure the content databases are available and have sufficient free space

This has to be one of the most difficult issues I had to solve with restoring a previously created SharePoint backup. Here are the different steps (based on your own scenario) I took to solve the above problem and restore my site collection:

Scenario 1)
This issue occurs if the computer that is running Windows SharePoint Services has insufficient free disk space that is available to host the restored Windows SharePoint Services Web site. This issue may also occur if the Windows SharePoint Services database has reached its maximum allowed size.

Scenario 1 Solution) To resolve this issue, make sure that the computer that hosts the Windows SharePoint Services Web site has sufficient free disk space that is available before you restore the Windows SharePoint Services Web site. When backing up or restoring large site collections make sure that the site collection is set to "no access" if it exists already. Whether the site collection exists or not the -overwrite parameter can be used to bypass conflicts. stsadm -o restore -url -filename -overwrite

Scenario 2) The site collections listing page will give a clue.The site you were trying to restore was already listed there but when you tried to load it the site didn't work.

Scenario 2 Solution) •Detach and Reattach each of the content db's , this removed the site collection listing from CA but the error still occurred
•Run stsadm -o databaserepair against the database's and it removed a bunch of orphaned records.

Scenario 3) There is tonnes of disk space (20 GB free for the restore of a 3 GB site collection) and tried again. It died with the same error. You run the following query in the SQL Server Management Studio:

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

As it turns out, the database server was trying to restore the site collection into was running SQL Server Express Edition had a file size cap of 4 GB. When this "farm" was set up, it was done so with a Basic install which by defaul installs SQL Express and inherits it's limitations. The site collection that was used was trying to restore broke the 4 GB limit and as a result the stsadm tool thought there wasn't any disk space available, when really there was a bunch to be had.

Scenario 3 Solution) Upgrading SQL Server Express to Developer/Standard/Workstation/Enterprise -
As a result upgrade the OFFICESERVERS instance of SQL Server running on that machine from Express to Developer (you can upgrade it to Developer/Standard/Workstation/Enterprise, whatever you have in terms of media/licensing). This ends up being pretty easy, you simply find the media/installer and run the setup.exe that you normally would but with an added argument of SKUUPGRADE=1.

setup.exe SKUUPGRADE=1

When the install wizard gives you get a chance, select the OfficeServers instance and upgrade the database engine. If you want a more detailed walkthrough, one is available here. When you're done, run the same SQL query above and the product edition should no longer be Express. After that small adventure, the restore will work like a charm.

Scenario 4) A lot of transactions in the ULS Logs and SQL Server Logs are growing out of control during the restore process that appear to interrupt the restore, especially if its a very large one.

Scenario 4 Solution) Try the following:
1. Stop IIS
2. Perform the Restore
3. Restart IIS
Basically you are preventing any SharePoint transaction from taking place while you perform the restore.

Scenario 5) Restore runs super slow (for example 6 hrs for a restore of 7 GB backup file) and right at the end throws the "insufficient space" error.

Scenario 5 Solution) Try the following:
2) Truncate content database transaction logs in SQL Server
3) Turn Mirroring off on all databases on the SQL Server
4) Ensure that the account performing restore has dbowner and dbcreator permissions