INTRODUCTION
I’m in the process of configuring SharePoint RBS Remote Blob Storage for a client’s SP 2016 on-premise installation. I thought I would be sharing in this article the steps I took to actually make it work. Some of the articles on the net are only partially working, so hopefully this article can paint a complete picture.
There is also additional complexity is that both DEV and UAT environment shares the same instance of SQL server which, by default, RBS installation does not support.
INSTALLING AND CONFIGURING RBS
- Install SQL Server
- Enable FILESTREAM, to do so, follow this Microsoft’s article https://technet.microsoft.com/en-US/library/cc645923(v=sql.120).aspx
- Ensure you’re running it with the Farm account, and ensures it has SQLÂ sysadmin role. Then, using SQL Management Studio right click on the SP content database > New Query. Assuming your content DB name is WSS_Content, run the following:
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
Change C:\Blobstore above to any drive you wish to store the blob storage files in.
4. Still in the SQL Server, download RBS.msi from the following:
For SharePoint Server 2016, choose the correct install from the following list:
- Microsoft SQL Server 2014 Feature Pack
- Microsoft SQL Server 2014 SP1 Feature Pack
- Microsoft SQL Server 2014 SP2 Feature Pack
- Microsoft SQL Server 2016 Feature Pack
- Microsoft SQL Server 2016 SP1 Feature PackFor SharePoint 2013, choose the correct install from the following list:
- Microsoft® SQL Server® 2008 R2 Feature Pack
- Microsoft SQL Server 2008 R2 SP1 Feature Pack
- Microsoft SQL Server 2008 R2 SP2 Feature Pack
- Microsoft SQL Server 2008 R2 SP3 Feature Pack
- Microsoft SQL Server 2012 Feature Pack
- Microsoft SQL Server 2012 SP1 Feature Pack
- Microsoft SQL Server 2012 SP2 Feature Pack
- Microsoft SQL Server 2012 SP3 Feature Pack
- Microsoft SQL Server 2014 Feature Pack
- Microsoft SQL Server 2014 SP1 Feature Pack
5. Still in SQL Server, open Command Prompt as Administrator and run the following in the folder you download RBS.msi into:
msiexec /qn /lvx* rbs_install_log.txt /i RBS.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME=“WSS_Content” DBINSTANCE=“DBInstanceName” FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1
Note in Red above the values you need to update to reflect your environment.
Once you have run the above, go to “Programs and Features” in Control Panel and you should be able to see SQL Remote Blob Storage application installed.
Also, if you open the log file rbs_install_log.txt, near at the very end of the file you should see this text:
Product: SQL Remote Blob Storage – Installation completed successfully.
Furthermore, through SQL Management Studio, if you reload your content database, you would be able to see RBS tables created. They are denoted with the word “mssqlrbs“.
6. Now, go to your SP Server. If you have multiple servers in your farm, starts with Central Admin server first. Download RBS.msi again from the link above. I would simply copy RBS.msi from SQL Server to my SP server. Then, in SP Server, open Command Prompt as Administrator, go to where RBS.msi is located and run the following:
msiexec /qn /lvx* rbs_install_log.txt /i RBS.msi DBNAME=”WSS_Content” DBINSTANCE=”DBInstanceName” ADDLOCAL=Client,Maintainer,ServerScript,FilestreamClient,FilestreamServer
Similar to previously, go to “Programs and Features” and you should see SQL RBS installed. In the log file you would also be able to see a successful message near the end of the file.
Repeat step 6 for all servers in your farm. This command is pretty much installing RBS client onto your SP environment.
7. Ensure your Farm Account and IIS App Pool account of your SP web application is a dbo in the content database. This would allow SharePoint to communicate with RBS.
8. Then, in your SP Central Admin server, open SharePoint Management Shell and run the following:
$cdb = Get-SPContentDatabase WSS_Content
$rbss = $cdb.RemoteBlobStorageSettings
$rbss.Installed()
$rbss.Enable()
$rbss.SetActiveProviderName($rbss.GetProviderNames()[0])
$rbss
The command above switches your SharePoint site from using content DB storage to using RBS storage for file uploads.
9. Finally, test if RBS is working. To do that, simply go to any library in your SP web app, and just upload any document. Then, go to SQL Server and go to your RBS drive eg. c:\Blobstore. You should be able to see your uploaded files in there.
INSTALLING MULTIPLE RBS FOR DIFFERENT ENVIRONMENT USING SAME SQL INSTANCE
As mentioned earlier, this particular client of mine only has 1 SQL Server with the same instance for their DEV and TEST environment. Now that we’ve configured RBS for, let’s say, DEV, we need to run the same for the TEST environment.
You may think that you can just simply repeat the steps, the thing is, we’ve already installed RBS on the SQL Server and is already running as a program there. So how do we do this? If you have similar scenario, follow the steps below:
- On the TEST content database eg. WSS_Content_TEST, run the following:
use [WSS_Content_TEST]
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_TEST]
if not exists
(select groupname from sysfilegroups
where groupname=N’RBSFilestreamProvider2‘)
alter database [WSS_Content_TEST]
add filegroup RBSFilestreamProvider2 contains filestream
—
use [WSS_Content_TEST]
alter database [WSS_Content_TEST]
add file (name = RBSFilestreamFile2, filename =
‘c:\BlobstoreTEST‘)
to filegroup RBSFilestreamProvider2
Please ensure the text highlighted in blue isn’t the same as the first one, otherwise it will not work.
2. Still in SQL Server, run the following but please ensure you’re using the new configuration:
msiexec /qn /lvx* rbs_install_log.txt /i RBS.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME=”WSS_Content_TEST” DBINSTANCE=”DBInstanceName” FILESTREAMFILEGROUP=RBSFilestreamProvider2 FILESTREAMSTORENAME=FilestreamProvider_2
3. Then in your 2nd SP Farm ie. TEST, run the following:
msiexec /qn /i rbs.msi REMOTEBLOBENABLE=1 FILESTREAMPROVIDERENABLE=1 DBNAME=”WSS_Content_TEST” FILESTREAMSTORENAME=FilestreamProvider_2 ADDLOCAL=EnableRBS,FilestreamRunScript DBINSTANCE=”DBServer”
4. Finally, in Central Admin run the following in SP Shell:
$cdb = Get-SPContentDatabase WSS_Content_TEST
$rbss = $cdb.RemoteBlobStorageSettings
$rbss.Installed()
$rbss.Enable()
$rbss.GetProviderNames()
$rbss.SetActiveProvider(‘FilestreamProvider_2‘)
$rbss
You should see “FilestreamProvider_2” displayed in the Management Shell. This indicates that your TEST environment is now connected to the 2nd RBS in the same SQL server.
Hope this helps,
Tommy