I recently moved my MR database to a new server. I forgot to remove the data mart integration before I restored the database on the new server. Now I’m getting errors. What can I do to fix this?
We’ve all been there; backed up the ManagementReporter database without removing the integration. Now when you try to add the integration on the new server, it fails or now are getting errors in our log files in the configuration console . But no worries, we can remove the integration records in the restored MR database. You’ll want to follow these steps:
1. Open the MR Configuration Console and stop the MR Application service and the MR Process service.
2. Remove all integrations, if they exists.Run the following six-part script.
3. Run each section individually. Do not run the script as a whole.
Alter table [Connector].[Integration] DISABLE trigger ALL
Alter table [Connector].[Map] DISABLE trigger ALL
Alter table [Scheduling].[TaskCategory] DISABLE trigger ALL
Alter table [Scheduling].[Task] DISABLE trigger ALL
Alter table [Scheduling].[Trigger] DISABLE trigger ALL
DELETE FROM [Connector].[IntegrationGroup]
DELETE FROM [Connector].[Map] WHERE [MapId] IN (SELECT [Id] FROM [Scheduling].[Task] WHERE [CategoryId] IN (SELECT [Id] FROM [Scheduling].[TaskCategory] WHERE [ParentId] IN (SELECT [Id] FROM [Scheduling].[TaskCategory] where ParentID is null)));
DELETE FROM [Connector].[MapDefinition] WHERE [DefinitionId] NOT IN (SELECT DISTINCT DefinitionId FROM Connector.Map)
--3
DELETE FROM [Scheduling].[Task] WHERE [CategoryId] not IN (SELECT [Id] FROM [Scheduling].[TaskCategory] where ParentID is null)
DELETE FROM [Scheduling].[Trigger] where Id NOT IN (SELECT distinct TriggerId from [Scheduling].[Task])
DELETE FROM [Connector].[MapCategoryAdapterSettings]
Alter table [Connector].[Integration] ENABLE trigger ALL
Alter table [Connector].[Map] ENABLE trigger ALL
Alter table [Scheduling].[TaskCategory] ENABLE trigger ALL
Alter table [Scheduling].[Task] ENABLE trigger ALL
Alter table [Scheduling].[Trigger] ENABLE trigger ALL
DELETE FROM [Connector].[Integration]
DELETE FROM [Scheduling].[TaskCategory]
5. Add the integration.
If you get an error while trying to run the scripts above, check the number of records in the scheduling.message table:
select count (*) from Scheduling.Message
If there are a large amount of records, you’ll want to truncate the table and then run the six-part script again.
truncate table scheduling.message
For the full steps for restoring the MR database to a new server, see the blog below:
*This post is locked for comments