NotesReplication + NotesReplicationEntry: Managing Database Replication Settings with LotusScript
You’re preparing a maintenance window across a Domino environment with dozens of NSFs. You need to pause replication on all of them beforehand, and restore it cleanly afterward — without opening Admin Client for each one. Or you’re building a deployment tool that adjusts replication priority on dev environments before pushing changes.
Every NSF has exactly one replication configuration. NotesReplication is the LotusScript interface to that configuration — the same settings you see on the Replication Info tab in database properties.
TL;DR
- Every
NotesDatabasehas exactly oneNotesReplicationobject, obtained viadb.ReplicationInfo - You must call
Save()after every property change — unlike most LotusScript classes, modifications stay in memory until explicitly saved IsDisabled: pause or resume replicationPriority: replication priority (REPLICATION_PRIORITY_LOW/MED/HIGH)Abstract: truncate large documents and strip attachments on replication (bandwidth saving)ClearHistory(): clears replication history, forcing a full resync on the next replication cycleNotesReplicationEntry: per-server-pair rules (selective replication formulas, etc.)
Getting the NotesReplication object
Dim session As New NotesSessionDim db As NotesDatabaseSet db = session.CurrentDatabase
' Every database has exactly one replication settings objectDim repl As NotesReplicationSet repl = db.ReplicationInfo
Print "Replication disabled: " & repl.IsDisabledPrint "Priority: " & repl.PriorityPausing and resuming replication
' Pause replication on this databaserepl.Disabled = TrueCall repl.Save()Print "Replication paused"
' Resumerepl.Disabled = FalseCall repl.Save()Print "Replication resumed"Save() is mandatory. Unlike most LotusScript property changes that persist automatically, NotesReplication changes only live in memory until you call Save() — skip it and nothing actually changes in the NSF.
Adjusting replication priority
' Set to low priority (common for dev/test environments)repl.Priority = REPLICATION_PRIORITY_LOWCall repl.Save()
' Set to high priority (critical databases)repl.Priority = REPLICATION_PRIORITY_HIGHCall repl.Save()Priority constants:
| Constant | Meaning |
|---|---|
REPLICATION_PRIORITY_LOW | Low priority |
REPLICATION_PRIORITY_MED | Medium (default) |
REPLICATION_PRIORITY_HIGH | High priority |
REPLICATION_PRIORITY_NOTSET | Not configured |
Abstract — reduce bandwidth by truncating documents
' Enable Abstract: large documents are truncated, attachments stripped' Useful for bandwidth-constrained replication, not for normal business NSFsrepl.Abstract = TrueCall repl.Save()Abstract tells Domino to truncate large documents and remove attachments during replication. Useful in low-bandwidth scenarios where you need metadata sync but not full document content. Not appropriate for most production business databases.
ClearHistory — force a full resync
' Clear replication history → next replication will be a full scanCall repl.ClearHistory()' ClearHistory doesn't need a separate Save() callPrint "Replication history cleared"Use cases: after database repair following corruption, or when forcing a full resync between two servers after maintenance. Note: the next replication after ClearHistory will scan every document in the database — expensive on large NSFs. See the ClearHistory method documentation for details.
Reset — discard pending changes
' Changed your mind mid-way? Reset reverts all property changes' back to the last saved state (the opposite of Save)Call repl.Reset()NotesReplicationEntry — per-server-pair rules
NotesReplicationEntry manages the rules for replication between a specific pair of servers:
' Get the entry for the SourceServer → TargetServer pairDim entry As NotesReplicationEntrySet entry = repl.GetEntry("SourceServer/ACME", "TargetServer/ACME")
If Not (entry Is Nothing) Then Print "Replication enabled to target: " & entry.IsEnabled Print "Selective formula: " & entry.Formula ' Modify and save entry.Formula = "Type = ""Order""" Call entry.Save()End If
' List all entriesDim entries As Variantentries = repl.GetEntries()If IsArray(entries) Then Dim i As Integer For i = 0 To UBound(entries) Print "Entry: " & entries(i).Source & " → " & entries(i).Destination NextEnd IfIn practice: batch-pause replication across a server
Sub PauseAllReplication(serverName As String) Dim session As New NotesSession Dim dbDir As NotesDbDirectory Set dbDir = session.GetDbDirectory(serverName)
Dim db As NotesDatabase Set db = dbDir.GetFirstDatabase(DATABASE)
Dim count As Integer count = 0 Do Until db Is Nothing If db.IsOpen Then Dim repl As NotesReplication Set repl = db.ReplicationInfo If Not repl.IsDisabled Then repl.Disabled = True Call repl.Save() count = count + 1 End If End If Set db = dbDir.GetNextDatabase() Loop
Print "Paused replication on " & count & " databases"End SubWhat about Java and SSJS?
| Language | Counterpart |
|---|---|
| LotusScript | NotesReplication / NotesReplicationEntry |
| Java | lotus.domino.Replication / ReplicationEntry (drop the Notes prefix; .recycle() when done) |
| SSJS | No direct equivalent — replication management in XPages is typically done via the Domino REST API or server console commands |