replicate (NotesDatabase - JavaScript™)
Replicates a local database with its replica(s) on a server.
Defined in
NotesDatabaseSyntax
replicate(server:string) : boolean
Parameter | Description |
---|---|
server |
The name of the server with which you want to replicate. Any replica of the source database that exists on the server will replicate. |
Return value | Description |
---|---|
boolean |
|
Usage
Successful replication does not necessarily mean that documents replicate. The replication settings are honored. For example, if replication is temporarily disabled on one of the databases, the replication task runs without error but no documents actually replicate.The source database must be local or an exception occurs.
Examples
This button replicates a specified local database with a known server.try {
var db:NotesDatabase = session.getDatabase(null, requestScope.query, false);
if (db == null) {
requestScope.status = "No such database: " + requestScope.query;
return;
}
if (db.replicate("Sales1/Acme")) {
requestScope.status = "Replicated with: " + requestScope.query;
} else {
requestScope.status = "Replication failed with: " + requestScope.query;
}
} catch(e) {
requestScope.status = "Replication failed with: " + requestScope.query;
}