createReplica (NotesDatabase - JavaScript)

Creates a replica of the current database at a new location.

Defined in

NotesDatabase

Syntax

createReplica(server:string, dbfile:string) : NotesDatabase
Parameter Description
server The name of the server where the replica will reside. Specify null or an empty string ("") to create a replica on the current computer.
dbfile The file name of the replica.
Return value Description
NotesDatabase The new replica.

Usage

If a database with the specified file name already exists, an exception is thrown.

The new replica has the same access control list as the current database.

Programs making remote (IIOP) calls to a server can't create or access databases on other servers. In these cases, the server parameter must correspond to the server the program is running on. There are two ways to do this:
  • Use null or an empty string ("") to indicate the current computer. This is the safer method.
  • Make sure the name of the server that the program runs on matches the name of the server parameter.

Programs running on a client can access several different servers in a single program.

Examples

This button creates a local replica of a database on a server.
var db:NotesDatabase = session.getDatabase("notes1/west", "test/DatabaseEtc");
var title:string = db.getTitle();
var replica:NotesDatabase = db.createReplica(null, "dbetc");
requestScope.status = "Database \"" + title + "\" has a new local replica";