maandag 7 juni 2010

SharePoint 2007 and Remote BLOB Storage (RBS)

Intro
Especially for large SharePoint environments, remote BLOB storage could mean a real advantage. Used with SharePoint 2007, it allows the storage of BLOBS on a (remote) fileshare instead of storing it all in the content database.
Microsoft advises to keep the maximum size of your content databases between 100 and 150 gigabyte. For large installations, this is not always possible. Not in the beginning of the project and espacially not for the future, where the size of the system will only grow. Without RBS, this would mean you would have to use different site collections. This brings along some difficulties of which the following are the most important ones for me:

1. How are you going to decide what will be in which site collection ?
2. What about all those out of the box SharePoint 2007 components which will only work within one single site collection ?

I started to read about RBS, which is called EBS (External BLOB Storage) in SharePoint and found out there wasn't really so much info to find which really told me how to implement it. Therefore, I'm writing this post (very late at night) to at least help you on the way and quickly get it up and running in your environment. Please keep in mind that I discovered some drawbacks to this technique which are covered at the end of this article. So maybe read that part first and then decide weather you want to continue or not.

Basic information
If you want to understand the basics of what EBS is and how it is implemented for SharePoint, read this article.
This article tells some more about the architecture of EBS and how it can be implemented (high level).

The real deal
Follow the following simple steps to get EBS up and running in no time for SharePoint 2007.

1. Download this package. It is Pav Cherny's implementation of the managed and unmanaged COM component which is needed to handle the traffic from and to the remote share where are remote/external BLOBS will be stored.
2. Open the solution. The solution contains a console application, a C# project (managed code) and a C++ project (unmanaged code). Choose which one you want to use and compile that project. The post build events will register the DLL in the GAC automatically.
3. Create your share and make sure the application pool account of your SharePoint web application has sufficient rights to that share. I gave it full control.
4. In the registry file, enter the path of your share then execute the file so the location of your share is registered in the registry.
However, pay attention when developing the EBS provider on a 64bit platform. 64 bit COM objects must be registered in another place in the registry. You can do this by using the regasm.exe tool, located in %WINDIR%\Microsoft.NET\Framework64\v2.0.50727.
5. In the properties of the console application project, enter the GUID of the component you want to be used as the COM component in the arguments section. The console application will use this GUID to register that COM component at farm level.

If everything is write, the COM component is now registered and ready to be used. Try it by uploading a document and investigating the file share.

Common issues
When you find the following error in your log files, you probably did not correctly register your EBS provider. As stated above, watch out with 64bit COM components.



When you don't get this specific error in your log files but do get the error in SharePoint (the screen at the back), this probably means you don't have sufficient rights to your shared drive so check the permissions there. Especially check the application pool account.

Drawbacks
What I discoved was that after registering the COM component, I wasn't able to create any new web applications or site collections via the Central Administration. During the process, SharePoint told me some files couldn't be found anymore. I have to investigate this further to solve it.

Conclusion
If I get the drawbacks fixed, this feature really is a great way to deliver SharePoint solutions for very big environments by consolidating everything in one site collection allowing us to keep using all of the out of the box components.

zondag 6 juni 2010

Saving and restoring sites using WSP templates in SharePoint 2010

As you probably already know, stp files are not used anymore in SharePoint 2010. The extension which was used for site templates in SharePoint 2010 has been replaced by WSP files.

In this article I will quickly show you how to work with these kinds of backup files. First of all, don't bother using this technique on publishing sites. You will not have the option (via the GUI) to save the site as a template. I did not test it for all other site templates though. This article is based on a team site template.

If you still want to create WSP files from publishing sites, use the following URL extension: '_layouts/savetmpl.aspx'.

1. Create the WSP backup In your site settings, click on "Save site as template" under "Site actions". Enter a file name, a template name and choose to include or not include site contents. The process that follows will generate the WSP file which can be found in the Solution Gallery. The link to this gallery is provided to you after the WSP has been created. Download the file.

2. Create a new site sollection for this template Now, again in Central Administration, go to 'Application Management' and create a new site collection. As template, select 'Custom' and then 'Select template later ...'. Once created, visit the new site collection. Because there is not yet a default page, SharePoint will present you with a page where you can select the template for this site collection. Select 'Solution Gallery'.

3. Deploy the downloaded template WSP file With the stsadm tool or Powershell, deploy the solution package. For stsadm the command would be: stsadm -o addsolution -filename [path to you wsp file] The solution you just added to the system is a farm solution. So in Central Administration, go to 'System Settings' - 'Manage farm solutions'. Select your WSP and deploy it. In your new site collection, go to the site collection features by adding this to your URL: '/_layouts/ManageFeatures.aspx?Scope=Site'. Activate the template feature you just deployed.

4. Restore the backup Create your new site via the 'create new site' interface and choose your imported site template from the custom tab

vrijdag 4 juni 2010

SQL Server 2008 SP1 Invoke or BeginInvoke cannot be called on a control unit until the window handle has been created

Later today, I was preparing some new virtual images for a new SharePoint 2010 installation. I wanted to upgrade my MS SQL Server 2008 to SP1 but came across this message:

Invoke or BeginInvoke cannot be called on a control unit until the window handle has been created.
To solve the issue make sure the following server features are installed:
.NET Framework 3.5.1 Features -> .NET Framework 3.5.1
Windows Process Activation Service -> .NET Environment

After that restart the installation and everything should be fine !