I’m trying to compare the number of documents between replicas on two servers. The goal is to decommission one server if the same dbs exist with a reasonably similar number of documents. What I’m trying to do is get an array of mail dbs on each server (the path is slightly different) then compare them to find the duplicates. I get a count of docs as I go but am confused about how to store that variable.
Sub Initialize
On Error Goto ErrHndlr
Dim session As New NotesSession
Dim dbDir1 As New NotesDbDirectory(“Server1”)
Dim dbDir2 As New NotesDbDirectory(“Server2”)
Dim db1 As NotesDatabase, db2 As NotesDatabase
Dim maildb1 As NotesDatabase, maildb2 As NotesDatabase
Dim list1() As String, list2() As String
Dim ctr As Integer
Dim z As Variant
Open “c:\dblist.txt” For Output As #1
mailfolder = “COMAIL”
ctr = -1
Set db1 = dbDir1.GetFirstDatabase(DATABASE)
While Not (db1 Is Nothing)
path1 = Ucase(db1.FilePath)
If Ucase(Left(db1.FilePath, 6)) = “MAILAF” Then
server1 = “Server1”
Set maildb1 = New NotesDatabase(server1, db1.FilePath)
count1 = maildb1.AllDocuments.Count
ctr = ctr + 1
Redim Preserve list1(ctr)
list1(ctr) = path1
End If
Set db1 = dbDir1.GetNextDatabase()
Wend
ctr = -1
Set db2 = dbDir2.GetFirstDatabase(DATABASE)
While Not (db2 Is Nothing)
path2 = Ucase(db2.FilePath)
If Ucase(Left(db2.FilePath, 13)) = “COMAIL\MAILAF” Then
server2 = “Server2”
Set maildb2 = New NotesDatabase(server2, db2.FilePath)
count2 = maildb2.AllDocuments.Count
ctr = ctr + 1
Redim Preserve list2(ctr)
list2(ctr) = path2
End If
Set db2 = dbDir2.GetNextDatabase()
Wend
For x = 0 To Ubound(list1)
z = Arraygetindex(list2, mailfolder & "" & list1(x), 5)
If Not Isnull(z) Then
Print #1, list1(x)
End If
Next
ErrHndlr:
Print #1, Error & " " & Cstr(Erl)
Resume Next
End Sub