This process requires knowledge of SharePoint PowerShell and SQL server management studio. You will need to run t-sql commands on a specific database. This can be easily done easily with the help of a SharePoint Administrator and DBA.


Backup Settings DB


Please back up the prime settings database used in destination farm before you do below steps


Get Farm Ids


  • Login to source farm WFE as farm administrator
  • Run SharePoint 2010 Management shell as administrator
  • Run the following script and copy farm id value. We will call it SourceFarmId


$f = Get-SPFarm


$f.Id
See below image for reference.



 


  • Also, find SourceSiteId and SourceWebId by typing the following command as per the below image:


 



  • Login to destination farm WFE as farm administrator
  • Run SharePoint 2010 Management Shell as administrator
  • Run the same PowerShell script as above and copy the farm id value. We will call it DestinationFarmId, DestinationSiteId and DestinationWebId
  • Next, get webId by typing the following commands


Fix SQL entries


  • Connect to sql server of destination farm using sql server management studio with appropriate credentials.
  • Open a new query window and select prime settings database as the current database.
  • Now copy and paste the following script into the new query window
  • Paste SourceFarmId value between ‘’ in line 2 below
  • Paste DestinationFarmId value between ‘’ in line 4 below
  • Execute the query.


declare @sourceFarmId  varchar(max)


set @sourceFarmId = ''


declare @disasterFarmId varchar(max)


set @disasterFarmId = ''


 


update UserSettings


set SettingID = REPLACE(SettingID,@sourceFarmId , @disasterFarmId)


where SettingID like '%'+@sourceFarmId+'%'


 


Please see the following image for reference.


 



 


  • Repeat the process of to replace sourceSiteId and sourceWebId with destinationSiteId and detinationWebId.


Also, update this in WebId field of the same table by applying the following sql commands
declare @sourceSiteId nvarchar(100),


              @destinationSiteId nvarchar(100),


              @sourceWebId nvarchar(100),


              @destinationWebId nvarchar(100)


 


update UserSettings


set


       webId = @DestinationSiteId


where webId = @sourceSiteId


GO


update UserSettings


set


       webId = @destinationWebId


where webId = @sourceWebId


GO


 



Conclusion


  • After applying the above fix, all of your source farm settings should start working on your destination farm.