Manage Learn to apply best practices and optimize your operations.

Button To Create Local Database Replica

Create a button to give to users that will create a local replica of a database (or list of databases). Use this in an e-mail or in a shared database to distribute new databases to users.

(Tip: Save this button and just modify the database name(s) and server.)


In an e-mail or document select Create - Hotspot - Button and enter this code.

(Declarations)
Dim session As NotesSession
Dim db As NotesDatabase
Dim replica As NotesDatabase
Dim ServerName As String
Dim DBList List As String

Click
Sub Click(Source As Button)
Set Session = New NotesSession
Call FillDBList
Set db = session.CurrentDatabase
Forall dbnames In DBList
Set db = New NotesDatabase( "", "" )
Call db.Open( ServerName, dbnames )
If db.IsOpen Then
Set replica = New NotesDatabase("","")
If replica.OpenByReplicaID( "", db.ReplicaID ) Then
Print( replica.Title & " already has a local repliac" )
Else
Set replica = db.CreateReplica( "", dbnames )
Print "Creating replica of " + dbnames
Call replica.Replicate( ServerName )
End If
Else
Print "Unable to find database " + dbnames + " on server " + ServerName
End If
End Forall
End Sub

Sub FillDBList
'replace with your server and database names. Add to DBList as necessary
ServerName = "server1/acme"
DBList(1) = "directory/dbname1.nsf"
DBList(2) = "dbname2.nsf"
DBList(3) = "dbname3.nsf"
DBList(4) = "directory2/dbname4.nsf"
End Sub

Dig Deeper on Domino Resources - Part 2

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close