Service Bridge for Providers: Existing entitlements are not working in provider after upgrade from 1.x to 2.xIssue: Entitlements created in 1.x are removed/not working after upgrading to 2.x. If there are multiple entitlements for a configuration(RTD,RRP) i.e if there is an RRP or an RTD which is published to multiple consumers, then those entitlements needs to be fixed by choosing one of the below steps. If the existing entitlements are working(Entitlements are not yet refreshed): Navigate to System Definition -> Scripts - BackgroundExecute below code(one time script) in any one of these scopes(global or sn_sb_pro) var sbModel = new sn_sb.SBModel(); //Loop through RTD and update entitlements var rtdGR = sbModel.getMatching(sn_sb_pro.Constants.TABLE_PRO_REMOTE_TASK_DEFINITION,{'identity':['!=','']}); while (rtdGR.next()) { this.updateEntitlement(rtdGR); } //Loop through RRP and update entitlements var rrpGR = sbModel.getMatching(sn_sb_pro.Constants.TABLE_PRO_REMOTE_RECORD_PRODUCER,{'identity':['!=','']}); while (rrpGR.next()) { this.updateEntitlement(rrpGR); } function updateEntitlement(configGr) { //Retrieve entitlements which doesnt has identity var entitlementGr = sbModel.getMatching(sn_sb_pro.Constants.TABLE_PRO_ENTITLEMENT, { 'entity_reference': configGr.getUniqueValue(), 'identity':'' }); while (entitlementGr.next()) { try { //Entitlements update wont sync to consumer entitlementGr.setWorkflow(false); sbModel.update(entitlementGr, { 'identity': configGr.getValue('identity'), 'compatibility': configGr.getValue('compatibility'), 'revision': 0, 'consumer_active_revision': entitlementGr.getValue("consumer_status") == sn_sb.Constants.ENTITLEMENT_CONSUMER_STATUS_ACTIVE ? 1 : 0 }); } catch (ex) { gs.info('updateEntitlement - Unable to update entitlement for configGr with sysId - ' + configGr.getValue("sys_id") + ", error - " + ex); } } } 2. If the existing entitlements doesnt work after the upgrade(entitlements are refreshed). Navigate to Service Bridge for Providers -> ConsumersSwitch to Entitlements tab and remove the existing entitlements which are not workingCollect the sysids of the existing entitlements from consumer instancesNavigate to System Definition -> Deleted Records.Filter the list with table name as "sn_sb_pro_entitlement" and the sysids collected from consumer instance to document Key column.Open each record and verify the document key column. If the document key matches with the sysid of an entitlement in consumer instance, please click on "Undelete with Related" which will restore the deleted record back to the entitlementsOnce all the entitlements are restored, execute the below code snippet in the background scripts to add identity to the restored entitlements. var sbModel = new sn_sb.SBModel(); //Loop through RTD and update entitlements var rtdGR = sbModel.getMatching(sn_sb_pro.Constants.TABLE_PRO_REMOTE_TASK_DEFINITION,{'identity':['!=','']}); while (rtdGR.next()) { this.updateEntitlement(rtdGR); } //Loop through RRP and update entitlements var rrpGR = sbModel.getMatching(sn_sb_pro.Constants.TABLE_PRO_REMOTE_RECORD_PRODUCER,{'identity':['!=','']}); while (rrpGR.next()) { this.updateEntitlement(rrpGR); } function updateEntitlement(configGr) { //Retrieve entitlements which doesnt has identity var entitlementGr = sbModel.getMatching(sn_sb_pro.Constants.TABLE_PRO_ENTITLEMENT, { 'entity_reference': configGr.getUniqueValue(), 'identity':'' }); while (entitlementGr.next()) { try { //Entitlements update wont sync to consumer entitlementGr.setWorkflow(false); sbModel.update(entitlementGr, { 'identity': configGr.getValue('identity'), 'compatibility': configGr.getValue('compatibility'), 'revision': 0, 'consumer_active_revision': entitlementGr.getValue("consumer_status") == sn_sb.Constants.ENTITLEMENT_CONSUMER_STATUS_ACTIVE ? 1 : 0 }); } catch (ex) { gs.info('updateEntitlement - Unable to update entitlement for configGr with sysId - ' + configGr.getValue("sys_id") + ", error - " + ex); } } } Once the old entitlements are restored, refresh entitlements can be used whenever needed.