CARIS Bathy DataBASE Server : CARIS Bathy DataBASE Server : Command Prompt Tools : Database Clone Command
 

Database Clone Command

The BathyDBClone command creates a clone of a database. This command can be useful when:

moving databases between different versions of the same RDBMS.

moving databases from Oracle to PostgreSQL or vice versa.

The BathyDBClone command does not upgrade databases to newer versions of BDB Server. If you are in one of the above contexts and you want to upgrade to a newer version of BDB Server, this is a two step process:

1. Run the clone process.

2. Upgrade the BDB Server databases (this happens automatically when each database is started with the new version of BDB Server).

In order to retain the user settings and privileges for the databases being cloned, you must run the BathyDBUsersClone command prior to running this command. The Users Clone command will migrate existing users to the new RDBMS system. As the databases are cloned, the users found in the RDBMS will be assigned to their original databases. If the Users Clone is not run first, the pre-existing users will not be found by the system and will not be assigned to the databases during the clone.For information on running this tool, see Database Users Clone Command.

Custom Catalogues

The cloned database will have the same catalogue as the original database. If a custom catalogue was uploaded to the original database, that same catalogue will be used by the cloned database, not the catalogue defined by the "BathyObjectProfile" and "BathyObjectPool" environment variables.

Offline Objects

If the database being cloned contains offline database objects, ensure that all mandatory attributes for these objects are populated prior to running the clone command. Depending on what caused a database object to be set offline, there may be missing attribute values that are required to perform the clone. If you receive an error about attributes during a clone, you will need to repair the attributes in the previous version before the clone is attempted again.

When offline objects are cloned, they remain set to offline in the new database.

Running the BathyDBClone Command

The following is the command line format for the BathyDBClone tool and descriptions of the available parameters:

bathydbclone --login <value> --source <value> --destination <value> --fs_path <value> --backup_path <value> --log <value> --temp <value> --regen

The following table lists the parameters available for the BathyDBClone command.

Parameter

 

Long

Short

Description

--help

-h

Display the help message (command format and descriptions of the available parameters).

--login

-l

The credentials used to login to the Node Manager. These can be entered in any of the following formats:

username

username/password

username@hostname

username/password@hostname

If the password is not provided with the parameter (i.e. username or username@hostname parameter values) the system prompts for the password.

The hostname is the name or IP address of the computer on which the Node Manager service is installed and running. When hostname is not specified, it is assumed to be the local machine.

--source

-s

The location and name of the source database.

--destination

-d

Specify the name for the output database.

This name must meet specific naming restrictions. For details on the restrictions, refer to Naming Restrictions.

--fs_path

-p

Specify the output location for the Node Manager. This must be a location defined in the filesystemtable.bfs file, for example Root/TrainingDatabases.

--backup_path

-b

Specify the backup location for the new databases. This must be a location defined in the filesystemtable.bfs file, for example Root/Backups.

--log

Specify the name and location for the log file that will contain the details of the cloning.

--temp

-t

Regenerate the bounding polygon for each dataset being cloned to better reflect the extents of the data.

--regen

-r

Define a location for storing any temporary files used while cloning a database. If this parameter is not specified, the default Windows Temp directory will be used, which is C:\Users\<username>\AppData\Local\Temp.

This command can only be run using an administrator account.

To use this command:

1. Open the command prompt window.

2. Go to the BDB Server bin directory, for example

C:\Program Files\CARIS\BDB Server\<version>\bin.

The BathyDBClone command does not require a new, empty database to be prepared prior to executing the command. The new database will be created and started automatically.

3. Type “BathyDBClone” followed by the appropriate parameters.

4. To finish, press <Enter>.

The cloning process begins. During this process, the database is placed in maintenance mode and is inaccessible to users in both the BDB Administration Tools and BASE Editor. If the clone fails for any reason, the database that was created will remain in your node manager in Maintenance mode. You must remove this database before you can complete a successful clone of the data. To do this:

Restart the node manager.

Unregister the database.

Delete the database folder from the node location.

When finished, a clone of the specified database is placed in the output location and registered in the upgraded Node Manager.

Example:

You need to migrate an existing database, where:

the Node Manager username and password values are dba and sql respectively,

the database is located in the following directory C:\Data\BDBServer\Databases,

the name of the database is TrainingDB,

the cloned database is to be called TrainingDBClone,

the cloned database is to be registered to the Node Manager in the TrainingDatabases node location,

the bounding polygon for each dataset needs to be regenerated,

the default BDB Server Temp folder will be used, and

a log file will be created with the name DatabaseCloneLog, in the C:\Program Files\CARIS\BDB Server\5.4\logs directory.

Type the following:

Bathydbclone -l "dba/sql" -s "C:\Data\BDBServer\Databases\TrainingDB" -d "TrainingDBClone" -p "Root/TrainingDatabases" -r --log "C:\Program Files\CARIS\BDB Server\5.4\logs\DatabaseCloneLog.txt"