Force Domino directory replication to all servers
When cleaning up a domain and reconfiguring servers, domains and routes one critical success factor is the distribution of changes to all servers. In a well maintained domain the replicator task will take care of that. However that might take hours and if the domain you are working on is well maintained, there is little need for a clean-up in the first place .
To be independent from replication schedules and other quirks I got an agent at hand that helps me there. You can copy that agent to your Domino Directory and take a few easy steps:
Update::Agent code now available in the downloads section.
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.
To be independent from replication schedules and other quirks I got an agent at hand that helps me there. You can copy that agent to your Domino Directory and take a few easy steps:
- Create a local replica of the Domino directory
- Copy the agent into it
- Make sure you have a Notes client that can reach ALL servers
- Make sure you have enough otherwise to do (or run this agent from a VMWare)
Update::Agent code now available in the downloads section.
'Replicate with all Servers: Option Public Option Declare Sub Initialize Dim db As NotesDatabase Dim nab As NotesDatabase Dim nLog As NotesLog Dim s As New NotesSession Set nab = s .CurrentDatabase 'The error log, not essential but handy --- use your own mechanism to get one 'Suggestion: The managers of the DB get a mail log Set nlog = New NotesLog ( "Replicate with all servers" ) Call nlog .OpenAgentLog nlog .LogErrors = True nlog .LogActions = True 'Here we set the database to be replicated -- for now it is the NAB, but it is just one statement. Set db = s .CurrentDatabase 'Call the main function Call ReplicateLocalDB (nab , db , nlog ) 'Close our log Call nlog . Close End Sub Function getAdminServer (db As NotesDatabase , nlog As NotesLog ) As String Dim acl As NotesACL On Error Goto Err_getAdminServer Set acl = db .ACL getAdminServer = acl .AdministrationServer Exit_getAdminServer : Exit Function Err_getAdminServer : Call nlog .LogError ( Err , Error$ & " in getAdminServer in line " & Cstr ( Erl ) ) getAdminServer = "" Resume Exit_getAdminServer End Function Sub ReplicateWithOneServer (db As NotesDatabase , serverName As String ,nlog As Noteslog ) On Error Goto Err_ReplicateWithOneServer Call db .Replicate (serverName ) Exit_ReplicateWithOneServer : Exit Sub Err_ReplicateWithOneServer : Call nlog .LogError ( Err , Error$ & " in ReplicateWithOneServer line " & Cstr ( Erl ) & ", Server: " & serverName ) Print Error$ 'Mostly: Timeout or no replica found Resume Exit_ReplicateWithOneServer End Sub Sub ReplicateLocalDB (nab As NotesDatabase , db As NotesDatabase , nlog As NotesLog ) Dim v As NotesView Dim adminServer As String Dim curServer As String Dim doc As NotesDocument On Error Goto Err_ReplicateLocalDB If db .Server < > "" Then Msgbox "Please run this from a local replica!" Exit Sub End If 'Find the admin server to give the first shot to it adminServer = getAdminServer (db , nlog ) 'Now Replicate the admin server Call ReplicateWithOneServer (db , adminServer ,nlog ) 'Get the view with all servers, Set v = nab .GetView ( "($Servers)" ) Set doc = v .GetFirstDocument Do Until doc Is Nothing If doc .HasItem ( "ServerName" ) Then curServer = doc .GetItemValue ( "ServerName" ) (0 ) Call ReplicateWithOneServer (db , curServer ,nlog ) End If Set doc = v .GetNextDocument (doc ) Loop Exit_ReplicateLocalDB : Exit Sub Err_ReplicateLocalDB : Call nlog .LogError ( Err , Error$ & " in ReplicateLocalDB line " & Cstr ( Erl ) ) Resume Exit_ReplicateLocalDB End Sub
provided by Julian Robichaux at nsftools.com.
Posted by Stephan H Wissel on 27 September 2006 | Comments (5) | categories: Show-N-Tell Thursday