Uninstalling an RBSProvider

Mar 11, 2010 at 10:15 AM

Hi Guys,

I am trying out the RBS-Feature of SharePoint 2010 and SQL Server 2008 R2. Well, I installed my own Provider successfully. Now I want to disable RBS on my ContentDB and migrate all documents back to the Database. I have read that I have to use the commands $rbss.Disable() and $rbss.Migrate() (PowerShell), but when I call them, I always get an MethodInvocationException:


PS C:\Users\Administrator> $rbss.Disable()
Exception calling "Disable" with "0" argument(s): "The server configuration information has been updated. SqlRemoteBlob
Context object is not valid. Recreate the SqlRemoteBlobContext to fix this error."
At line:1 char:14
+ $rbss.Disable <<<< ()
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodTargetInvocation

PS C:\Users\Administrator> $rbss.Migrate()
Exception calling "Migrate" with "0" argument(s): "The specified blob store could not be found in the c
urrent database."
At line:1 char:14
+ $rbss.Migrate <<<< ()
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodTargetInvocation


Well, without migrating the documents back to the ContentDB, I am not able to uninstall my provider. (The UninstallProvider.cmd tells me that I have to delete the Pool with ID xx-xx-xx... before uninstalling the provider)

Is there any other way to push the documents back into the ContentDB so that I can delete/uninstall my provider?

 

greetings

Doomdrake

Editor
Mar 11, 2010 at 7:03 PM

Hi Doomdrake,

This is a question around SharePoint tools and I have asked the SharePoint folks for an answer (this codeplex site is owned by the SQL Server team). The answer is that perhaps you have done things in the wrong order. The recommended sequence is:

  1. Set the active RBS provider to none: $rbs.SetActiveProviderName("")
  2. Migrate all the data from blob storage to WSS inline: $rbs.Migrate()
  3. Disable RBS: $rbs.Disable()
  4. Remove all the blobs from blob storage by running RBS Maintainer. Before running Maintainer, do the following on the ContentDB:
    1. exec mssqlrbs.rbs_sp_set_config_value 'garbage_collection_time_window','time 00:00:00'
    2. exec mssqlrbs.rbs_sp_set_config_value 'delete_scan_period','time 00:00:00'
  5. Uninstall RBS (database component) by running the following store procedure: exec mssqlrbs.rbs_sp_uninstall_rbs 0

You can ask SharePoint product-related questions at http://connect.microsoft.com/office.

Thanks,

Pradeep.

Mar 12, 2010 at 9:20 AM

Well, thanks for you answer. I followed you instructions for deactivating my provider, but still getting an exception (see below).


PS C:\Users\Administrator> $rbss.SetActiveProviderName("")
PS C:\Users\Administrator> $rbss.Migrate()
Exception calling "Migrate" with "0" argument(s): "The blob store <MyProvider> threw an exception. The exception thr
own is saved in InnerException."
At line:1 char:14
+ $rbss.Migrate <<<< ()
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException


Well I have done the following steps:

- Remove all References to RBS from my Server (Including the SQL Remote Blob Storage software and old WebApplications with activated RBSProviders)
- Create a new WebApplication
- Install RBS and activate on this ContentDB
- Install my RBSProvider and activate it on the ContentDB
- Creating a Document on SharePoint

- Set Active Provider to ""
- Call "Migrate()" -> Exception


greetings

Doomdrake

Mar 12, 2010 at 9:33 PM

Hi Doomdrake,

By looking at the exception from the Migrate , it looks like the exception is coming from your provider  ? Did you trace your provider to see if we can Upload and Download documents successfully ? Can you also attach ULS logs around the time of Migrate exception . ULS logs can be found on SharePoint WFE @ %commonprogramfiles%\Microsoft Shared\Web Server Extension\14\Logs folder.

-Thanks

Rahul.

 

 

 

 

Mar 16, 2010 at 9:20 AM

Hi Guys,

thanks for your fast answers. I found the error, which caused the exception while migrating. Well, you were right, my provider caused that. Well now I migrated my documents back into the ContentDB, but I have to call the Maintainer now. What operations I have to do? How do I specify a ConnectionString? (I read, that i have to specify a "ConnectionStringName".)

Thanks for you help.

greetings
Doomdrake

Mar 16, 2010 at 5:43 PM

The connection string in the Maintainer are specified in the maintainer.exe.config file (lives with the exe) . The connection string are either all encrypted or none. The default connection string that the RBS specifies is always encrypted and its a good practice to encrypt the connection strings ..
Here is how you need to specify the connection strings :

[From any WFE where you want to run GC]

1.       For each content Database that is RBS enabled :Add content database connection string to the Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.config file

a.       Rename the existing config file to web.config using following command (located in %programfiles%\Microsoft SQL Remote Blob Storage 10.50\Maintainer )

cd /d %programfiles%\Microsoft SQL Remote Blob Storage 10.50\Maintainer

ren Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.config web.config

b.      Un-encrypt the connection strings from the config file by using following command (aspnet_regiis is located in %windir%\Microsoft.NET\Framework64\v2.0.50727

cd /d %windir%\Microsoft.NET\Framework64\v2.0.50727

aspnet_regiis.exe -pdf connectionStrings "%programfiles%\Microsoft SQL Remote Blob Storage 10.50\Maintainer"

c.       Add additional connection string to the web.config file for each content database that is rbs enabled like following . Change the name of connection string , data source and Initial Catalog as needed

    <connectionStrings>

        <add connectionString="Data Source=localhost;Initial Catalog=RemoteBlobStorage;Integrated Security=True;Application Name=&quot;Remote Blob Storage Maintainer&quot;"

            providerName="System.Data.SqlClient" />

        <add connectionString="Data Source=wsslab40;Initial Catalog=wss_content;Integrated Security=True;Application Name=&quot;Remote Blob Storage Maintainer for WSS_Content&quot;"

            providerName="System.Data.SqlClient" />

    </connectionStrings>

d.      Encrypt the web.config file again by using following command

cd /d %windir%\Microsoft.NET\Framework64\v2.0.50727

aspnet_regiis -pef connectionStrings "%programfiles%\Microsoft SQL Remote Blob Storage 10.50\Maintainer " -prov DataProtectionConfigurationProvider

e.      Rename the file back to original

cd /d %programfiles%\Microsoft SQL Remote Blob Storage 10.50\Maintainer

ren web.config Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.config

 Note: XML file is case sensitive, you need to use the exact string for 'connectionStrings' parameter above.

2.       Create a Maintenance Task using following steps (for each database)

1.       Click Start, point to Administrative Tools, and click Task Scheduler.

2.       Right-click Task Scheduler (Local) and click Create Task.

3.       Click the Actions tab and click New.

4.       On the New Action page, specify:

                                                                          i.      Action as Start a Program.

                                                                        ii.      For the Program/script, click Browse and navigate to the RBS Maintainer application; by default, the location is %programfiles%\Microsoft SQL Remote Blob Storage 10.50\Maintainer \Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.  

                                                                      iii.      In the Add Arguments (optional) field, enter the following parameter string:  (change the name of the connection string as specified in the config file earlier)

-ConnectionStringName RBSMaintainerConnection   -Operation GarbageCollection ConsistencyCheck  ConsistencyCheckForStores -GarbageCollectionPhases rdo -ConsistencyCheckMode r -TimeLimit 120

                                                                       iv.      Click OK

 

Note: XML file is case sensitive, you need to use the exact string for the connection string above.

 

5.       On the Triggers tab, click New.

6.       In the New task dialog box, set:

                                                                          i.      Begin the task to On a schedule.

                                                                        ii.      The trigger schedule to be Weekly, Sunday, at 2am (or at another time when system usage is low.)

                                                                      iii.      Click OK.

7.       On the General tab, enter a name for the task, such as “<Database Name> RBS Maintainer”, where <Database Name> identifies the database associated with the task. In the Security settings section:

8.       Make sure that the account under which the task is to be run has sufficient permissions   to the database.

9.       Select the option to Run whether user is logged on or not.

10.   Click OK.

Please refer the GC discussion @ http://blogs.msdn.com/sqlrbs/archive/2008/08/08/rbs-garbage-collection-settings-and-rationale.aspx on more information on the different GC options for RBS

Editor
Mar 20, 2010 at 12:14 AM

Added a related blog post on running maintainer.

http://sqlrbs.codeplex.com/Thread/View.aspx?ThreadId=205280