Sun Java System Calendar Server 6.3 Administration Guide

3.3 csmigrate Utility

The csmigrate utility is used to migrate Calendar Server 6.0, 6.1 or 6.2 databases to Calendar Server 6.3 databases. You can find the csmigrate utility in the sbin directory of the Calendar Server product along with other administrative tools.

This section contains the following topics:

3.3.1 csmigrate Utility Syntax

The syntax for the csmigrate command is:

csmigrate [-q] [-d] [-l min|max] [-b backup_dir] source_dbdir target_dbdir

The options and their usage are as follows:

-q (optional)

Specifies quiet mode and no print instructions.

-d (optional)

Specifies dry run mode and no new database written.

-l min|max (optional)

Specifies log level. The migration logs are written to csmigrate.log and errors are written to csmigrateError.log in the default logs directory.

-b backup_dir (optional)

Specifies the directory to backup source database. The program backs up the source database to this directory and works on that copy to prevent any damage to the source databases. Default location is the backup under the source database directory.

-source_dbdir (mandatory)

The directory where pre-migration database files are located.

-target_dbdir (mandatory)

The directory where post-migration files are created.

-V (other supported option)

To print the version information of the tool.

-? (other supported option)

To print the usage information of the tool.


Note –

The exit codes for the program are 255 on failure and 0 on success.


3.3.2 csmigrate Example

Examples of using the options in csmigrate command are:

csmigrate -b /var/opt/SUNWics5/tmpdb /var/opt/SUNWics5/old_db /var/opt/SUNWics5/new_db
csmigrate -q /var/opt/SUNWics5/old_db /var/opt/SUNWics5/new_db
csmigrate -l min old_db /var/opt/SUNWics5/new_db
csmigrate -l max old_db /var/opt/SUNWics5/new_db

ProcedureHow to Run the Calendar Server csmigrate Utility

  1. Log in with root privileges.

  2. Stop all services.

    For example, issue the following command:

    stop-cal
  3. Move your current databases to a temporary directory.

    For example, move the entire csdb directory to the oldcsdb.

    mv cal-svr-base/SUNWics5/csdb/* cal-svr-base/SUNWics5/oldcsdb
  4. Make sure both the new directory and old files in that directory are owned by the default administrator (icsuser, icsgroup).

    If the ownership is not correct, change ownership using the following command:

    chown -R icsuser:icsgroup /cal-svr-base/SUNWics5/oldcsdb/
  5. Run the migration tool.

    Migrate from your new backup copy (oldcsdb) to the csdb directory as shown in the following example:

    cd cal-svr-base/SUNWics5/cal/sbin/ 
    ./csmigrate -l max /cal-svr-base/SUNWics5/oldcsdb cal-svr-base/SUNWics5/csdb
  6. Restart calendar services.

    For example, use the following command:

    stop-cal