"Hack" SharePoint configuration database - Manually point to another configuration and content database SQL server in farm servers
Recently I was been told that SharePoint configuration and content database had been migrated and restored to another SQL server. I ran the SharePoint Production and Configuration Wizard to connect to the existing farm with the new SQL Serve Instance and same configuration database name. Once the wizard finished the process and the Central Admin site was ready, I went to the "Systems" page to check farm severs and saw the farm configuration database still showing the old SQL server instance.
As the Project Manager won't create a new farm and then reconfigure the SharePoint again, I have to come out another solution. Below is my idea to "hack" the SharePoint configuration database although MS not recommend this way. :)
I executed below SQL script against the [Objects] table and found out the old SQL server instance record is there.
SELECT TOP 1000 [Id], [ClassId], [ParentId], [Name], [Status], [Version], [Properties] FROM [SharePoint_Config].[dbo].[Objects]
where [Name] like '%<sql server name>%'
SELECT TOP 1000 [Id],[ClassId],[ParentId],[Name],[Status],[Version],[Properties]FROM [SharePoint_Config].[dbo].[Objects]where [Name] like '%<sql instance name>%'
Note: replace above "<sql server name>" (e.g. "SQLSrv01") and "SQL instance name" such as "MSSQLServer, 18999" parameters with your SQL server and instance name.
Once I found the [Id] and [ClassId] in above result, I executed below SQL script to update "SQL sever name" (e.g. "SQLSrv01") and "SQL instance" such as "MSSQLServer, 18999".
Update [SharePoint_Config].[dbo].[Objects]
set [Name]=<SQL Server Instance Name>'
where [id]='XXXXXX' and [classid]='XXXXXX'
Update [SharePoint_Config].[dbo].[Objects]
set [Name]='<SQL Server Name>'
where [id]='XXXXXX' and [classid]='XXXXXX
After I updated above SQL records and ran the SharePoint Production and Configuration Wizard again, I went to the server farm page and see the configuration database was changed to the new one!
This post is part of my project "Implement the Business Intelligence On Premises SharePoint 2013 Portal".
If you want to know more my experiences from the guide of above project, please sign up in here.
As the Project Manager won't create a new farm and then reconfigure the SharePoint again, I have to come out another solution. Below is my idea to "hack" the SharePoint configuration database although MS not recommend this way. :)
I executed below SQL script against the [Objects] table and found out the old SQL server instance record is there.
SELECT TOP 1000 [Id], [ClassId], [ParentId], [Name], [Status], [Version], [Properties] FROM [SharePoint_Config].[dbo].[Objects]
where [Name] like '%<sql server name>%'
SELECT TOP 1000 [Id],[ClassId],[ParentId],[Name],[Status],[Version],[Properties]FROM [SharePoint_Config].[dbo].[Objects]where [Name] like '%<sql instance name>%'
Note: replace above "<sql server name>" (e.g. "SQLSrv01") and "SQL instance name" such as "MSSQLServer, 18999" parameters with your SQL server and instance name.
Once I found the [Id] and [ClassId] in above result, I executed below SQL script to update "SQL sever name" (e.g. "SQLSrv01") and "SQL instance" such as "MSSQLServer, 18999".
Update [SharePoint_Config].[dbo].[Objects]
set [Name]=<SQL Server Instance Name>'
where [id]='XXXXXX' and [classid]='XXXXXX'
Update [SharePoint_Config].[dbo].[Objects]
set [Name]='<SQL Server Name>'
where [id]='XXXXXX' and [classid]='XXXXXX
After I updated above SQL records and ran the SharePoint Production and Configuration Wizard again, I went to the server farm page and see the configuration database was changed to the new one!
This post is part of my project "Implement the Business Intelligence On Premises SharePoint 2013 Portal".
If you want to know more my experiences from the guide of above project, please sign up in here.
Comments
Post a Comment