Migration SharePoint 2010 to 2013 with RBS content database

1.     Live SharePoint 2010 environment with SQL 2008 R2

a.    Take back up from 2010 live server.

  1. i.      Open management studio on SQL server.
  2. ii.      Take back up of content database of live application.

2.    QA SharePoint 2010 environment with SQL 2008 R2

a.    Restore SQL backup

  1. i.      Open management studio on SQL server.
  2. ii.      Restore database.

b.   Create Web Application

  1. i.      Open SharePoint server
  2. ii.      Open central admin
  3. iii.      Create web application with classic authentication.

c.    Dismount database which is with existing application

  1. i.      Open SharePoint PowerShell on SharePoint server.
  2. ii.      Fire below command.

Dismount-SPContentDatabase <Database name>

Note: Change the database name.

d.   Mount restored database with existing application

  1. i.      Open SharePoint PowerShell on SharePoint server.
  2. ii.      Fire below command.

Mount-SPContentDatabase <Database name>  -DatabaseServer  <Database server name > -WebApplication <Web application>

Note: Change the database name and web application URL.

  1. iii.      Open SharePoint Designer and change the master page and publish it.
  2. iv.      Set the Test page as Home page.
  3. v.      Test user logging
    1.        Logging with the 2-3 different users and test they can able to logging.

e.    Configure RBS

  1. i.      Enable FILESTREAM on the database server
    1.        Open SQL Server Configuration manager on SQL Server.
    2.        From left panel click on SQL Server Services.
    3.        From right panel select the instance of SQL Server on which you want to enable FILESTREAM.
    4.        Right-click the instance and then click Properties.
    5.        In the SQL Server Properties dialog box, click the FILESTREAM tab.
    6.        Select the Enable FILESTREAM for Transact-SQL access check box.
    7.        If you want to read and write FILESTREAM data from Windows, click Enable FILESTREAM for file I/O streaming access. Enter the name of the Windows share in the Windows Share Name box.
    8.        If remote clients must access the FILESTREAM data that is stored on this share, select allow remote clients to have streaming access to FILESTREAM data.
    9.        Click Apply and ok.
  2. ii.      Set FILESTREAM access level
    1.        Open SQL management studio and connect SQL database instance.
    2.        Right click on database instance and open Property.
    3.        Go to: click on advanced from left panel.
    4.        Find the “Filestream Access Level” property and set the value “Full access enabled”
    5.        Click OK and exit window.
  3. iii.      Set SharePoint Configure FILESTREAM access level
    1.        Open Query window on root
    2.        Execute  following query

EXEC sp_configure filestream_access_level, 2

RECONFIGURE

  1.        Restart SQL services

Note: You will get message” Configuration option ‘filestream access level’ changed from 2 to 2. Run the RECONFIGURE statement to install.”

  1. iv.      Provision a BLOB store for each content database
    1.        Click the content database for which you want to create a BLOB store, and then click New Query
    2.        Execute following query

use [<Database name>]

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′

Note:

  1. Change the database name
  2. You get “Command(s) completed successfully.” Message.

use [<Database name>]

if not exists

(select groupname from sysfilegroups

where groupname=N’RBSFilestreamProvider’)

alter database [<Database name>]

add filegroup RBSFilestreamProvider contains filestream

 

 

Note:

  1. Change the database name.
  2. You get “Command(s) completed successfully.” Message.

use [<Database name>]

alter database [<Database name>]

add file (name = RBSFilestreamFile, filename =

‘<E:\SQL\Data\XYZ>’)

to filegroup RBSFilestreamProvider

Note:

  1. Change the database name and store path.
  2. If you get message “FILESTREAM file ‘RBSFilestreamFile’ cannot be added because its destination filegroup cannot have more than one file.” Ignore it.
    1. v.      Install the RBS client library on each Web server
      1.        To install the RBS client library on the on the first Web server
        1. Open SharePoint Web server
        2. Open command prompt.
        3. Execute following command

msiexec /qn /lvx* rbs_install_log.txt /i RBS.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME=<Database name> DBINSTANCE=<Database server> FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1

Note:

  1. Change the database name and database instance name.
  2. DB instance should be <server name\instance name>
  3. Download RBS.msi for respective SQL version.
    1. To install the RBS client library on all additional Web and application serversOpen SharePoint Web server
      1. Open command prompt.
      2. Execute following command
      3. msiexec /qn /lvx* rbs_install_log.txt /i RBS.msi DBNAME=<Database name> DBINSTANCE=<Database server> ADDLOCAL=Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer

Note:

  1. Change the database name and database instance name.
  2. DB instance should be <server name\instance name>
    1. vi.      Enable RBS for each content database

You must enable RBS on one Web server in the SharePoint farm. It is not important which Web server that you select for this activity. You must perform this procedure once for each content database.

  1.        Open SharePoint web server
  2.        Open SharePoint PowerShell
  3.        Execute below script

$cdb = Get-SPContentDatabase <Database name>

$rbss = $cdb.RemoteBlobStorageSettings

$rbss.Installed()

$rbss.Enable()

$rbss.SetActiveProviderName($rbss.GetProviderNames()[0])

$rbss

Note: Change the database name.

  1. vii.      Test the RBS installation
    1.        On the computer that contains the RBS data store.
    2.        Browse to the RBS data store directory.
    3.        Confirm that size of RBS data store directory.
    4.        On the SharePoint farm, upload a file that is at least 100 kilobytes (KB) to a document library.
    5.        On the computer that contains the RBS data store.
    6.        Browse to the RBS data store directory.
    7.        Confirm that size of RBS data store directory.
    8.        It must be more than before.
  2. viii.      Test user logging
    1.        Logging with the 2-3 different users and test they can able to logging.

f.     Migrate RBLOB from RBS to SQL database and completely remove RBS

  1. i.      Migrate all content from RBS to SQL and disable RBS for content DB:
    1.        Open SharePoint server.
    2.        Open SharePoint management PowerShell
    3.        Execute below script

$cdb=Get-SPContentDatabase <Database name>

$rbs=$cdb.RemoteBlobStorageSettings

$rbs.GetProviderNames()

$rbs.SetActiveProviderName(“”)

$rbs.Migrate()

$rbs.Disable()

Note:

  1.        Migrate() might take some time depending on amount of data in your RBS store.
  2.        Change the database name.
  3.        If you get message on the PowerShell “PS C:\Users\sp2010_admin> $rbs.Migrate()

Could not read configuration for log provider <ConsoleLog>. Default value used.

Could not read configuration for log provider <FileLog>. Default value used.

Could not read configuration for log provider <CircularLog>. Default value used.

Could not read configuration for log provider <EventViewerLog>. Default value used.

Could not read configuration for log provider <DatabaseTableLog>. Default value used.” Then wait for while it will take some time to start migration.”

  1. ii.      Change the default RBS garbage collection window to 0 on your content DB:
    1.        Open SQL server
    2.        Open SQL management studio
    3.        Select your content DB and open new query window
    4.        Execute below SQL query

exec mssqlrbs.rbs_sp_set_config_value ‘garbage_collection_time_window’,’time 00:00:00′

exec mssqlrbs.rbs_sp_set_config_value ‘delete_scan_period’,’time 00:00:00′

Note:

  1.        Run one by one SQL query
  2.        You will get “Command(s) completed successfully.” Message
    1. iii.      Run RBS Maintainer (and disable the task if you scheduled it):
      1.        Open SharePoint server
      2.        Open command prompt
      3.        Run below command
      4.        “C:\Program Files\Microsoft SQL Remote Blob Storage 10.50\Maintainer\Microsoft.Data.SqlRemoteBlobs.Maintainer.exe” -connectionstringname RBSMaintainerConnection -operation GarbageCollection ConsistencyCheck ConsistencyCheckForStores -GarbageCollectionPhases rdo -ConsistencyCheckMode r -TimeLimit 120
    2. iv.      Uninstall RBS:
      1.        Open SQL server
      2.        Open SQL management studio
      3.        On your content DB run below SQL query

exec mssqlrbs.rbs_sp_uninstall_rbs 0

Note:

  1.        If you will get message “The RBS server side data cannot be removed because there are existing BLOBs registered. You can only remove this data by using the force_uninstall parameter of the mssqlrbs.rbs_sp_uninstall stored pro” then run this “exec mssqlrbs.rbs_sp_uninstall_rbs 1 ”
  2.        You will get “Command(s) completed successfully.” Message.
    1. v.      Uninstall from add/remove SQL Remote Blob Storage.

I found that there were still FILESTREAM references in my DB, so remove that reference

  1.        Open SQL server
  2.        Open SQL management studio
  3.        Run below SQL query on your content DB:

ALTER TABLE [mssqlrbs_filestream_data_1].[rbs_filestream_configuration] DROP column [filestream_value]

ALTER TABLE [mssqlrbs_filestream_data_1].[rbs_filestream_configuration] SET (FILESTREAM_ON = “NULL”)

Note:

  1.        Run one by one SQL query
    1. vi.      Now you can remove the file and filegroup for filestream:
      1.        Open SQL server
      2.        Open SQL management studio
      3.        Open new query window on top
      4.        Execute below SQL query

ALTER DATABASE <Database name> Remove file RBSFilestreamFile;

Note:

  1.        Change the database name
  2.        If it gives message “The file ‘RBSFilestreamFile’ cannot be removed because it is not empty.” Then remove all table prefix with “mssqlrbs_” from your database and execute SQL query again.
  3.        This query takes time as per your database size (almost 30 min).
  4.        You will get “The file ‘RBSFilestreamFile’ has been removed.” Message
    1.        Execute below SQL query

ALTER DATABASE <Database name> REMOVE FILEGROUP RBSFilestreamProvider;

 

Note:

  1. Change the database name
  2. You get “The filegroup ‘RBSFilestreamProvider’ has been removed.” Message.
  3. Or If you get “Msg 5524, Level 16, State 1, Line 1 Default FILESTREAM data filegroup cannot be removed unless it’s the last FILESTREAM data filegroup left.” message. Then ignore this message.
    1. vii.      Remove Blob Store installation
      1.        Open SharePoint server
      2.        Run RBS.msi setup file and choose Remove option.
      3.        Finish wizard.
    2. viii.      Disable FILESTREAM in SQL Configuration Manager

Disable FILESTREAM in SQL Configuration Manager for your instance (if you do not use it anywhere aside this single content DB with SharePoint), run SQL reset and IIS reset and test.

  1. ix.      Test the RBS Removed or not?
    1.        On the computer that contains the SQL database.
    2.        Confirm that size of SQL database (.mdf file).
    3.        On the SharePoint farm, upload a file that is at least 100 kilobytes (KB) to a document library.
    4.        On the computer that contains the SQL database.
    5.        Confirm that size of SQL database.
    6.        It must be more than before. If there is no difference then ignore it. Just check it Store is no more in SQL.
  2. x.      Test user logging
    1.        Logging with the 2-3 different users and test they can able to logging.

g.    Convert classic-mode web applications to claims-based authentication

  1. i.      Open SharePoint server
  2. ii.      Open SharePoint PowerShell
  3. iii.      Execute below script

$WebAppName = “<URL>”

$wa = get-SPWebApplication $WebAppName

$wa.UseClaimsAuthentication = $true

$wa.Update()

$account = “<Domain name\User name>”

$account = (New-SPClaimsPrincipal -identity $account -identitytype 1).ToEncodedString()

$wa = get-SPWebApplication $WebAppName

$zp = $wa.ZonePolicies(“Default”)

$p = $zp.Add($account,”PSPolicy”)

$fc=$wa.PolicyRoles.GetSpecialRole(“FullControl”)

$p.PolicyRoleBindings.Add($fc)

$wa.Update()

$wa.MigrateUsers($true)

$wa.ProvisionGlobally()

  1. iv.      Test user logging

Logging with the 2-3 different users and test they can able to logging.

h.   Take SQL backup from QA server

  1. i.      Open SQL server
  2. ii.      Open management studio on SQL server
  3. iii.      Select the content database
  4. iv.      Take back up of content database

 

Information: This SQL backup is not content RBS.

3.    New SharePoint 2013 environment with SQL 2012

a.    Restore SQL backup

  1. i.      Open SQL server
  2. ii.      Open SQL management studio
  3. iii.      Restore the SQL database using *.bak file

b.   Dismount database which is with existing application

  1. i.      Open SharePoint server
  2. ii.      Open SharePoint management PowerShell
  3. iii.      Execute below script

Dismount-SPContentDatabase <Database name>

Note: change the database name which bind with existing application.

c.    Mount restored database with existing application

  1. i.      Open SharePoint server
  2. ii.      Open SharePoint management PowerShell
  3. iii.      Execute below script

Mount-SPContentDatabase <Database name> -DatabaseServer <Database server name> -WebApplication <URL>

Note:

  1.        Change the database name with new restored database name
  2.        Change the database server name in form of “DB server name\DB instance name”
  3.        Change the URL of web application
  4.        This command take some time.

d.   Upgrade site collection

  1. i.      Open SharePoint server
  2. ii.      Open new site
  3. iii.      You will find message on top “Experience all that SharePoint 15 has to offer. Start now or Remind me later”
  4. iv.      Click on “Start”
  5. v.      Click on ”Upgrade this Site Collection”
  6. vi.      Click on “I Am ready”
  7. vii.      After some time you will get message “Upgrade Completed Successfully”
  8. viii.      Test User logging.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s