?
Solved

Automation of Replication Setting

Posted on 2006-06-07
8
Medium Priority
?
293 Views
Last Modified: 2013-12-18
I have a need to check and modify the setting of the "Do Not Send Deletions Made In This Replica To Other Replicas" on nearly 1,200 Lotus Notes R6 accounts.

Obviously automating it would be the way to go so I downloaded the API Toolkit from IBM and created an application to make the change but it appears that the one function I need to use (LNDatabase:SetReplicateSendDeletions) has a bug and will not work.

Does anyone have ideas how to make the changes to all users to have this option unchecked?  I need to be able to uncheck it if checked or leave it alone if not.

0
Comment
Question by:mtshipp
8 Comments
 
LVL 22

Expert Comment

by:mbonaci
ID: 16852412
Hi mtshipp,
you need to call this on all dbs you want disabled for replication:

    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim rep As NotesReplication

    Set db = session.CurrentDatabase
    Set rep = db.ReplicationInfo
    rep.Disabled = True
    Call rep.Save()

Hope this helps,
Marko
0
 
LVL 22

Expert Comment

by:mbonaci
ID: 16852440
mtshipp,
oh sorry, I meant you need to disable.

To uncheck it if checked or leave it alone if not:

    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim rep As NotesReplication

    Set db = session.CurrentDatabase
    Set rep = db.ReplicationInfo
    If rep.Disabled Then rep.Disabled = False

    Call rep.Save()


Hope this helps,
Marko
0
 
LVL 22

Expert Comment

by:mbonaci
ID: 16852471
mtshipp,
are those by any chance user's mail databases?

Marko
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 22

Accepted Solution

by:
mbonaci earned 1200 total points
ID: 16852769
Uh, my mistake, I thought of "Temporarily disable replication" option.
For that option (to not replicate outgoing deletions) use property
    IgnoreDeletes

To not replicate incoming deletions use:
     IgnoreDestDeletions


    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim rep As NotesReplication

    Set db = session.CurrentDatabase
    Set rep = db.ReplicationInfo
    If rep.IgnoreDeletes Then rep.IgnoreDeletes = False

    Call rep.Save()


Hope this helps,
Marko
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16853012
It is better to put the script above (once you assembled it correctly) in the PostOpen of the database, with the following logic:
    if this is a local replica then
        catch errors!
        deselect send_deletions
    end if

You need to catch errors, for the user who runs the code might not have sufficient permission to change the setting.

As a matter of fact, this might be a very big problem. You (with your privileges) cannot reach local replica's of a database to activate something. It must be the owner/user of the replica who activates the code. I wouldn't know if the user himself has sufficient rights to alter the setting you need. I hope so, but you'd better just try it.
0
 

Author Comment

by:mtshipp
ID: 16854193
Thanks for the help but the

IgnoreDeletes and IgnoreDestDeletes

changes the value of the deletions setting in the Advanced Tab of the Replication settings.  I need to modify the value of the "Do Not Send Deletions Made In This Replica To Other Replicas" setting on the Send Tab.
0
 
LVL 18

Assisted Solution

by:marilyng
marilyng earned 800 total points
ID: 16858250
Interesting.

Just tested the script Marko posted from Designer Help:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim rep As NotesReplication
Set db = session.CurrentDatabase
Set rep = db.ReplicationInfo
If Not rep.IgnoreDeletes Then
  rep.IgnoreDeletes = True
End If
Call rep.Save()

It does set the Send Tab, "Do Not Send Deletions Made ..." Notes R6.5.3  is it different in another version?

----------
As sjef says, in order for this to work on local replicas, enforce a consistent access control would need to be set to on, and an administration server set for the SERVER copy, and the ACL needs to contain the name of the agent signer.

TOL: the script can be set on the post open to look for a local copy, or see if the database is a local copy, and set the property.

TOL: can you set the Advanced tab on the SERVER copy to not accept deletions ? (ah, maybe not if the server replicates with other servers, huh?)

Maybe enhanced a bit as sjef and marko suggest:

      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim rep As NotesReplication
      Set db = session.CurrentDatabase
      Dim repID As String
      repID = db.ReplicaID
      
      Dim sendTo As String
      Dim subject As String
      Dim message As String
      Dim result As Boolean
      Result = True
      'Add your mail address here
      'sendTo = "Who Gets The Error Message"
      sendTo = "nobody@nowhere.com"
      
      On Error  Goto Handle_Error
      Dim localDB As New NotesDatabase("","")
      If localdb.OpenByReplicaID("",repID) Then
            Set rep = db.ReplicationInfo
            If Not rep.IgnoreDeletes Then
                  rep.IgnoreDeletes = True
                  Call rep.Save()
            End If            
      Else            
            Subject="Unable to Open Local Replica of : " + db.Title + " for " + session.commonusername
            Result = False
      End If
      
ExitHere:
      If result = False Then
            Dim maildoc As NotesDocument
            Set maildoc = db.CreateDocument
            With maildoc
                  .SendTo = sendTo
                  .Subject = subject
                  .Body= subject + Chr(13) + "Time of error: " + Format(Now()) + Chr(13) + message
                  .send False
            End With
      End If
      If Not localdb Is Nothing Then Set localdb = Nothing
      Exit Sub
      
Handle_Error:
      On Error Goto 0
      message=  "There was an error processing set local replica: " + Error$ + "-" + Str(Err) + _
      Chr(13)
      result = False
      Resume exitHere
      Exit Sub

--------------
If this is the mail database, hmm.. then create a new mail template from the existing one (name it something different, this way you can roll back if you have to, and you will have to create new mail templates for each of the templates that you use where you want this to occur)

OPen the Database Resources to the Database Script and paste into the Post Open event.  Use a Notes ID that has manager rights to the database and is listed in the ECL.   Save.  

Adjust the template Name in the Database Properties (Database File is a Master Template) and give it another name: "MailR6-NoDelete"

Then test by switching the template on a test account mail database.

Whatcha think, guys?

0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16859578
Seems good to me... I'd add an <On Error Goto 0> and I'd remove the last Exit Sub, but that's more esthetics.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question