search cancel

Items whose attributes prevented replication will not replicate after being changed to replicable

book

Article ID: 162239

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

The attributes of Organizational Group items were, at one time, set to 516 (non-replicable) in order to prevent them from replicating (as recommended for specific reasons in TECH200746). But after changing the attributes back to 512 (replicable) the items failed to replicate during the next differential replication cycle.  Nor would they replicate during a complete replication cycle.
 
 

Cause

Because the attributes were, at one time, set to non-replicable, the Organizational Group items were entered into the “ReplicationItem” table with the “IsReplicable” bit set to 0. This is to be able to quickly determine which items, during the initial phases of replication, should be evaluated, and which ones can be discarded. The end result is the items will not get replicated because they were once declared by their attributes not to be replicable.

Flipping the IsReplicable column to 1 is not enough. The items need to be removed from ItemReplication before the next replication cycle.
 

Resolution

Flipping the IsReplicable column to 1 is not enough. The items need to be removed from ItemReplication before the next replication cycle.  The following query example, when run against the parent’s database, will remove all references to Organizational Group items (scoped collections) that were at one time identified as non-replicable, but whose attributes now allow it.
 
Example #1 – All Organizational Groups
 

DELETE r 
FROM   replicationitem r 
       
JOIN vitem i 
         
ON i.guid = r.guid 
            
AND ( i.attributes & 4 ) = 0 
WHERE  i.classguid = 'A1BBB63E-7194-4282-AB92-64E27FA2C18D' 
       
AND r.isreplicable = 0  


 
Example #2 – Organizational Group by Guid


DECLARE @guid UNIQUEIDENTIFIER 
SET @guid = '<guid>' 

UPDATE 
item 
SET    
attributes = 512 
WHERE  guid = @guid 
DELETE 
r 
FROM   
replicationitem r 
       
JOIN vitem i 
         
ON i.guid = r.guid 
            
AND ( i.attributes & 4 ) = 0 
WHERE  r.guid = @guid 
       
AND IsReplicable = 0 

 
 

Example #3 – Organizational Group by name variable
 

DELETE r 
FROM   replicationitem r 
       JOIN vitem i 
         ON i.guid = r.guid 
            AND ( i.attributes & 4 ) = 0 
WHERE  i.classguid = 'A1BBB63E-7194-4282-AB92-64E27FA2C18D' 
       AND i.NAME LIKE '%Organizational Group%' 
       AND r.isreplicable = 0