Since recently upgrading to SQL Server 2008 R2, we decided to do some testing with the new feature called Remote Blog Storage. This new feature allows files to be stored locally on disk if it exceeds a specified size, thereby reducing the size of SharePoint content databases.
There are several resources on the net that provide a step by step guide on how to configure RBS. However, no one guide worked completely for me. Hence, I decided to write by own guide by pulling the stuff that worked for me from several guides
You will need:
- SharePoint 2010
- SQL Server 2008 R2
- RBS Client (http://go.microsoft.com/fwlink/?LinkID=165839&clcid=0x409)
- Enable FILESTREAM on the target SQL Server Instance.
- Provision the RBS Data Store.
- Install the Microsoft SQL Server 2008 R2 Remote Blob Store
- Enable Remote Blob Storage
- Configure Minimum Blob Storage Size
- Test the RBS Data Store
Provision the RBS Data Store
EXEC sp_configure filestream_access_level, 2 RECONFIGURE
For the following statements, replace WSS_Content with the name of your database and c:\Blobstore with the location and name of your blob store.
use [WSS_Content] if not exists (select * from sys.symmetric_keys where name = N'##MS_DatabaseMasterKey##') create master key encryption by password = N'Admin Key Password !2#4'
use [WSS_Content] if not exists (select groupname from sysfilegroups where groupname=N'RBSFilestreamProvider') alter database [WSS_Content] add filegroup RBSFilestreamProvider contains filestream
use [WSS_Content] alter database [WSS_Content] add file (name = RBSFilestreamFile, filename = 'c:\Blobstore') to filegroup RBSFilestreamProvider
Install the Microsoft SQL Server 2008 R2 Remote Blob Store
Download the RBS Client and copy it to all your web front end servers (WFE).
On the first WFE, open Command Prompt with ‘Run as Administrator‘. For each of the following msiexec commands, replace WSS_Content with your database name and DBInstanceName with the name of your database instance, e.g. vm100 or vm100\sharepoint.
Navigate to where you downloaded the RBS_X64.msi file and type the following command:
msiexec /qn /lvx* rbs_install_log.txt /i RBS_X64.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="WSS_Content" DBINSTANCE="DBInstanceName" FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1
Open the rbs_install_log.txt file and look for the line:
Product: SQL Remote Blob Storage -- Configuration completed successfully
The log file should be more than 1 MB if the configuration was successful.
On the database server, run the following query in SQL Server Management Studio to check if the RBS tables have been created.
use WSS_Content select * from dbo.sysobjects where name like 'rbs%'
You should see something like the following in the results panel.
msiexec /qn /lvx* rbs_install_log.txt /i RBS_x64.msi DBNAME=”WSS_Content” DBINSTANCE=”DBInstanceName” ADDLOCAL=Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer
$cdb = Get-SPContentDatabase WSS_Content$rbss = $cdb.RemoteBlobStorageSettings $rbss.Installed()$rbss.Enable()$rbss.SetActiveProviderName($rbss.GetProviderNames())$rbss
$database = Get-SPContentDatabase WSS_Content $database.RemoteBlobStorageSettings.MinimumBlobStorageSize=1048576 $database.Update()
This will set the minimum size of your blob store to 1MB.
New-SPSite -url <your sharepoint site collection> -owneralias <account name> -contentdatabase <blob database>
Note: you have to define a managed path first before you run the above command.
Once your site has been created, upload a file that is greater than the minimum blog storage size you specified in the previous step.
Now, browse to the location of your blob store, e.g. c:\Blobstore