Sun Java logo     Previous      Contents      Index      Next     

Sun logo
Sun Java System Calendar Server Administration Guide 

Chapter 4
Migration Utilities

After you install Calendar Server, and configure it, you may need to migrate the component databases and the LDAP database. Several migration utilities are provided to bring your down level databases up to the current version. A Migration Utility Roadmap is provided in this chapter to assist you in choosing the correct utilities to run.

This chapter contains the following sections:


Overview of Calendar Server Migration Utilities

Calendar Server 6 2004Q2 provides two types of database migration utilities:

Component Databases Migration Utilities

Component databases contain the events and todos for all calendar users and resources. The following utilities migrate component databases:

LDAP Databases Migration and Upgrade Utilities

LDAP databases contain authentication (user and resource entries) and calendar preferences information. The following utilities upgrade or migrate LDAP data:


Migration Utility Roadmap

Since there are so many potential utility choices, Figure 4-1 shows a roadmap meant to assist you in determining what order to use the utilities.


Note

ics2migrate is bundled with the Sun ONE Calendar Server 5.1.1 download. And csmig and csvdmig are bundled with Sun Java System Calendar Server 6 2004Q2.

If you have Netscape Calendar Server 3.5, you must migrate to Netscape Calendar Server 4.x before using ncs4migrate. This migration utility is available from Sun’s technical support.


Figure 4-1   Roadmap for Running the Calendar Server Migration Utilities

This figure shows a roadmap for running the Calendar Server migration utilities.

After you have installed Calendar Server 6.x and run cs5migrate, decide which if any of the other migration utilities you need to run. Figure 4-2 shows the different configuration scenarios and which migration utilities to run for each.

Figure 4-2  Configuration Scenarios

This figure shows several configuration scendarios that influence which LDAP migration utility to run.


Migrations Web Site

To further assist you in making the proper choices for your particular site, additional information and the utility downloads can be obtained from technical support who will direct you to a Web site.

At the Web site, you will be required to answer a short questionnaire, which will help you determine which of the utilities to use, and help you calculate what kind of downtime you can expect for the migration process.


Caution

If your site is configured for limited virtual domain mode or multiple instances of Calendar Server, contact your Sun Microsystems Inc. sales account representative for an evaluation of your migration requirements and to ensure that you have the specific migration utility that supports those requirements.


In some cases, you will be referred to Sun Microsystems Technical Support or Professional Services for assistance.


Note

Even though cs5migrate appears to be bundled with the Calendar Server product, if you try to run the utility, the following message appears:

!!!!!!!!!!PLEASE NOTE!!!!!!!!!!

To migrate to Calendar Server 6.0, please contact your Sun Microsystems Technical Support or Sales Account Representative to get the latest version of the utility.



ics2migrate

The ics2migrate utility migrates iPlanet Calendar Server 2.x calendar data and LDAP user preferences to Sun ONE Calendar Server 5.x.

This section describes:

Migration Requirements

Calendar Server 2.x to 6.x migration requires the following hardware and software:

The source machine and destination machines can be different servers or the same server. For a list of supported platforms refer to the Sun Java System Calendar Server Release Notes.

What Gets Migrated?

The following table lists the Calendar Server 2.x data and describes how ics2migrate migrates the data to Calendar Server 6.x.

Table 4-1  Migration of Calendar Server 2.x Data

Calendar Server 2.x Data

Migration Results for Calendar Server 6.0

Calendar Properties (calprops)  

Updates the Calendar Server calprops database.

Events

Updates the Calendar Server events database.

Todos

Updates the Calendar Server todos database

Alarms

Updates the alarms database while writing events and todos.

The following table lists the Calendar Server 2.x LDAP attributes and describes how ics2migrate migrates the attributes to Calendar Server 6.x.

Table 4-2  Migration of LDAP Attributes 

Calendar Server 2.x LDAP Attribute

Calendar Server 6.0 LDAP Attribute

nswcalUser *

icsCalendarUser *

nswcalCalID

icsCalendar

nswcalExtendedUserPrefs  

icsExtendedUserPrefs

ceCalList **

icsSubscribed

ceAgendaList **

icsSet

ceDefaultAgenda **

icsDefaultSet

ceDefaultTZID **

icsTimeZone

ceFirstDayWeek **

icsFirstDay

* Objectclass

** Originally part of nswcalExtendedUserPrefs

Migration Process

To migrate from 2.x to 5.x:

 


Caution

Before you run ics2migrate, back up your calendar database using a utility such as csbackup, the Sun StorEdge Enterprise Backup™ software, or Legato NetworkerŽ.

Backing up your calendar database is very important because db_upgrade upgrades the database in place. If a problem occurs during the upgrade, your database could be left in an unrecoverable state.


Run the db_recover on your 2.x Berkeley Database

Run the Berkeley DB db_recover utility to merge the log file transactions into the database before you convert it. If you do not use this utility, you will lose the unmerged transactions.

Download and Install Calendar Server 5.1.1

Refer to the iPlanet Calendar Server 5.1 Installation Guide found at:

http://docs.sun.com/db/doc/816-5516-10

Upgrade the 2.x Calendar Database

Calendar Server 5.1.1 requires Berkeley DB version 3.2.9 from Sleepycat Software. Before you run ics2migrate, you must use the Berkeley DB db_upgrade utility to upgrade your calendar database to version 3.2.9. Calendar Server 5.x includes the Berkeley DB utilities in the following directory:

cal_svr_base/opt/SUNWics5/cal/tools/unsupported/bin

For more information about the Berkeley DB utilities, refer to the following web site:

http://www.sleepycat.com/docs/utility/index.html

To upgrade your database to version 3.2.9:

  1. On Solaris and other UNIX systems, login as the user and group under which Calendar Server is running, such as icsgroup and icsuser.
  2. If necessary, stop the 2.x Calendar Server.
  3. Back up your calendar 2.x database, if you have not already done so.
  4. Remove (delete) any old share (__db_name.share) or log (log.*) files from the following directories:
  5. cal_svr_base/opt/SUNWics5/cal/lib/http

    cal_svr_base/var/opt/SUNWics5/csdb

  6. Run the db_upgrade utility to upgrade your 2.x calendar database to version 3.2.9. If you are not in the same directory with the 2.x calendar database, use the -h option to point to the database files.
  7. Notes You must run db_upgrade on all 2.x database files (alarms.db, calprops.db, events.db, and todos.db). You must also run db_upgrade on all front-end and back-end servers in your Calendar Server configuration, even if a server is not directly connected to a calendar database.

  8. Locate the Calendar Server 2.x caldb.conf file in the csdb directory with the database files and change the first line in the file as follows:
  9. Old value:  caldb.version "1.0.0 [BerkeleyDB]"

    New value:  caldb.version= "1.0.0 [BerkeleyDB]"

    Note If this file is not in the csdb directory, create it using a text editor and then set the first line to the new value.

Migrate the Data (run ics2migrate)

Follow these steps to run ics2migrate:

  1. Change to the directory where ics2migrate is located.
  2. Run ics2migrate using the syntax in ics2migrate Syntax.
  3. After migration, make sure that the caldb.berkeleydb.homedir.path parameter in the ics.conf file points to the migrated database.
  4. Run the csdb check command and, if necessary, the csdb rebuild command to rebuild your calendar database.
ics2migrate Syntax
To migrate both the Calendar Server 2.x database and LDAP user preferences

ics2migrate [-q] [-s def|none] [-f def|none] [-l min|max] source target

To migrate only the Calendar Server 2.x database

ics2migrate [-q] [-m db] [-s def|none] [-f def|none] [-l min|max] source target

To migrate only the LDAP user preferences

ics2migrate [-q] [-m ldap]


Note

To display the syntax, type ics2migrate without any options.


Table # lists the ics2migrate options with a description of each option.

Table 4-3   ics2migrate Options 

ics2migrate Option

Description

[-q]

Run in quiet mode. If the migration is successful, ics2migrate does not display information on the console. If the migration fails, ics2migrate displays only errors.

The default is verbose mode.

[-m db|ldap]

db – Migrate only the calendar database.

ldap – Migrate only the LDAP user preferences.

The default is to migrate both the calendar database and LDAP user preferences.

[-s def|none]

def – Grant scheduling access to only a user’s default calendar.

none – Deny scheduling access to all users’ calendars.

The default is to grant scheduling access to all calendars.

[-f def|none]

def – Grant free/busy access to only a user’s default calendar.

none – Deny free/busy access to all users’ calendars.

The default is to grant free/busy access to all calendars.

[-l min|max]

min – Log the minimum data migration statistics: calendar ID, primary owner, and number of events and todos for each calendar.

max – Log the maximum data migration statistics: minimal statistics plus the number of attendees and alarms for each event and todo.

ics2migrate logs statistics to ics2migrate.log in the cal_svr_base/opt/SUNWics5/cal/sbin directory.

By default, ics2migrate displays migration statistics on the console and does not generate a log file.

source

Directory where the Calendar Server 2.x database files are located.

source is required for database migration if the -m db option is specified, or if the -m option is omitted.

target

Directory where the Calendar Server 6.0 database files are located.

target is required for database migration if the -m db option is specified, or if the -m option is omitted.

Check the Migration Results

After you have finished the migration, check the results:

Migration Examples

This section has examples for the following topics:

Migrate in Quiet Mode

Perform the same migration as the previous example, except operate in quiet mode. ics2migrate does not display migration statistics on the console or generate a log file.

ics2migrate -q /var/opt/SUNWicsrv/2x_db /var/opt/SUNWics5/50_db

Migrate Only the Calendar Database

Migrate only the 2.x calendar database stored in the 2x_db directory (relative to the current directory) and create a 6.0 database in the /var/opt/SUNWics5/50_db directory.

ics2migrate -m db 2x_db /var/opt/SUNWics5/50_db

Migrate Only LDAP User Information

Migrate only the Calendar Server 2.x LDAP user information to version 6.0 format.

ics2migrate -m ldap

Migrate Both Calendar Database and LDAP User Information

Migrate both the LDAP user information and the Calendar Server 2.x database. The Calendar Server 2.x database is stored in the /var/opt/SUNWicsrv/2x_db directory and the 6.0 database is in the /var/opt/SUNWics5/50_db directory.

Grant scheduling and free/busy access to all calendars and log minimal migration statistics in a log file named ics2migrate.log.

ics2migrate /var/opt/SUNWicsrv/2x_db /var/opt/SUNWics5/50_db -l min


csmig

The csmig utility assigns an owner to each calendar in the calendar database and maps each calendar ID (calid) to an owner, if needed.

The csmig utility supports hosted (virtual) domains and the LDAP Calendar Lookup Database (CLD) plug-in. Calendars in the migrated database are then accessible using this plug-in. The LDAP CLD plug-in provides horizontal scalability of the calendar database by allowing calendars to be distributed over a number of back-end servers. For information about the LDAP CLD plug-in, see the Sun Java System Calendar Server 6 2004Q2 Administration Guide.

This section describes the following topics:

csmig Functions

The csmig migration utility performs these functions:

csmig Requirements

The requirements for using csmig are:

csmig Syntax

The csmig utility has the following syntax:

csmig [ -t DestinationDB ] [ -b Backend-DWPHost ]
      [ -o OutputFile ]  [ -e ErrorFile ] [ -m MappingFile ]
        -c calendarOwner -r resourceOwner { migrate|dryrun }

-t DestinationDB specifies the destination target database that csmig generates. The default is MigratedDB.

-b Backend-DWPHost specifies the name of the DWP back-end host server. This name must match the DWP back-end host server name specified in the ics.conf file.

-o OutputFile specifies an output file that captures the csmig output to the screen as well as any errors that occur. The default is MigrateOut.

-e ErrorFile is the file where csmig writes any errors or database entries that cannot be resolved. If database entries cannot be resolved, they are not written to the destination database. The default is MigrateError.

-m MappingFile is an output mapping file generated in dryrun mode that list entries in the LDAP schema that need to be changed. For example:

Old calid = jsmith New calid = jsmith:basketball

The mapping file provides only a list of changes to make to the LDAP schema. csmig does not actually make the changes to the schema.

In migrate mode, MappingFile is not used.

-c calendarOwner specifies the owner for user calendars that don’t have owners.

-r resourceOwner specifies the owner for resource calendars that don’t have owners.

csmig Migration Steps

After you have installed Calendar Server 6.0 on all of the servers in your configuration, you must run csmig to migrate your existing Calendar Server and LDAP data to the new Calendar Server 6.0 and LDAP data, which is required for the LDAP CLD plug-in to work properly. Use these steps to migrate calendar data using csmig:

  1. Configure Your LDAP Directory Server–Adding indexes can greatly improve the performance of your migration and calendar searches on LDAP data.
  2. Perform a Test Dry Run–A dry run reports what csmig would do during a migration, but it does not migrate any actual data. After the dry run, you can correct any errors and determine a plan to handle any unresolved calendars.
  3. Migrate Your Production Data–During a production run, csmig migrates the calendar database (.db files) and LDAP data (user and group preferences data), icsSubscribed, icsCalendar, icsCalendarOwned, icsFreeBusy, icsSet, and uid (for resource calendars). After the migration, all calendar resources will have an LDAP entry created.

Configure Your LDAP Directory Server

To improve performance, consider adding the following two new indexes to the slapd.ldbm.conf file:

For information about creating indexes in the slapd.ldbm.conf file, refer to your directory server documentation.

Perform a Test Dry Run

A test dry run performed on a staging server reports what would be migrated, but it does not perform the actual migration of your production database. A dry run allows you to determine a plan for migrating your production database. For example, you can decide how you want to handle “orphan” calendars, which are calendars that don’t have an owner.

To perform a test dry run using csmig, follow these steps:

  1. Log in as icsuser (or as the Calendar Server runtime user ID specified during configuration). If you run csmig as superuser (root), you might need to reset the permissions for the migrated files.
  2. Install Calendar Server 6.0 (if necessary) on the staging server.
  3. Copy a snapshot of your calendar database to the staging server.
  4. Install an LDAP server to mimic the production LDAP environment. Install a snapshot of the LDAP database on this server with the new indexes in the slapd.ldbm.conf file.
  5. Change to the cal_svr_base/opt/SUNWics5/cal/sbin directory.
  6. Consider creating a catchall calid for user calendars that don’t have an owner. For example, on Solaris systems, the following command creates a user with the calid of orphan:
  7. ./csuser -g orphan -s adminuser -y password -l en -c orphan create orphan

  8. Stop the Calendar Server using the stop-cal command (if necessary).
  9. Run the csdb check command to check your database for corruption. If corruption is indicated, run csdb rebuild to rebuild the database.
  10. Run csmig with the dryrun option. For example, on a Solaris system, enter:
  11. ./csmig -b sesta.com -o csmig.out -e csmig.errors -m csmig.map -c orphan -r calmaster dryrun

    This command assigns user calendars without an owner to orphan and resource calendars without an owner to calmaster.

    Check the output mapping file (csmig.map). The mapping file lists entries that need to be updated in the LDAP schema.

  12. Check the output, mapping, and error files. Resolve any LDAP issues or errors that you find. Determine how you will handle any unresolved calendars before the actual migration. Several options are:
    • Delete any unneeded calendars before you migrate.
    • Assign owners to any unresolved calendars.
    • Allow csmig to assign owners to the calendars during migration using the -c and -r options.
  13. Migrate your calendar database on your staging server before you migrate your actual production calendar database. This steps allows you to see exactly how your data will be migrated and to correct any problems before you migrate your production database.
  14. For example, on a Solaris system, the following command migrates the calendar database to the /var/opt/SUNWics5/testcsdb/ directory:

    ./csmig -t /var/opt/SUNWics5/testcsdb/ -b sesta.com -o csmig.out -e csmig.errors -m csmig.map -c orphan -r calmaster migrate

  15. After the test migration is finished, copy the migrated database to the /csdb directory specified by the caldb.berkeleydb.homedir.path parameter. Or, edit this parameter to point to the new location of the migrated database. Then perform these checks:
    • Run csdb check on the new calendar database. The number events and todos in the migrated database should match the pre-migration totals.
    • Search for icsCalendarOwned entries and make sure that the entries match the pre-migration number of calendars.
    • Login to Calendar Express and verify some of the calendars in the migrated database.

If the test migration is successful, you are ready to migrate your production database.

Migrate Your Production Data

To migrate your production database using csmig, follow these steps:

  1. Log in as icsuser (or as the Calendar Server runtime user ID specified during configuration). If you run csmig as superuser (root), you might need to reset the permissions for the migrated files.
  2. Change to the cal_svr_base/opt/SUNWics5/cal/sbin directory.
  3. Stop the Calendar Server using the stop-cal command (if necessary).
  4. Backup the following data:
    • Calendar database (.db files).
    • LDAP data: slapd database directory and LDAP database.
    • ics.conf file. This step is not actually required, but it can be useful if you need to revert to your original configuration.
  5. Run csmig with the migrate option. For example, on a Solaris system, the following command migrates the calendar database to the /var/opt/SUNWics5/newcsdb/ directory:
  6. ./csmig -t /var/opt/SUNWics5/newcsdb/ -b sesta.com -o csmig.out -e csmig.errors -m csmig.log -c orphan -r calmaster migrate

  7. Check for any unresolved calendars in the error file and resolve them according to your plan from Step 10 under Perform a Test Dry Run.
  8. Copy the new migrated database to the /csdb directory specified by the caldb.berkeleydb.homedir.path parameter. Or, edit this parameter to point to the new location of the migrated database.
  9. Run the csdb check command to check your migrated database. If any corruption is indicated, run csdb rebuild to rebuild the database.
  10. Enable the LDAP CLD plug-in by making any necessary changes to the following configuration parameters in the ics.conf file:
    • service.dwp.enable = "yes"
    • service.dwp.port = "9779"
    • csapi.plugin.calendarlookup = "y"
    • csapi.plugin.calendarlookup.name = "*"
    • caldb.cld.type = "directory"
    • caldb.dwp.server.default = "default-server-name"
    • caldb.dwp.server.server-hostname.ip = "server-hostname" (for each back-end server including the local server)
    • caldb.cld.cache.enable = "yes" (if you want to use the CLD cache option)
    • caldb.cld.cache.homedir.path specifies the location of the CLD cache directory. The default is cal_svr_base/var/opt/SUNWics5/csdb/cld_cache.

      Check that this directory is correct, or if you want a different location for the CLD cache, modify this parameter.

      For information about setting configuration parameters for the LDAP CLD plug-in, see the Sun Java System Calendar Server 6 2004Q2 Administration Guide.

  11. Restart the Calendar Server using the start-cal command.
  12. Log in to the Calendar Server and verify that your configuration is working by checking several of the migrated calendars. To disable alarms while you are making your checks, set each of the following parameters in the ics.conf file to “no”:
    • caldb.serveralarms = "no"
    • caldb.serveralarms.dispatch = "no"
    • service.ens.enable = "no"
    • service.notify.enable = "no"
    • ine.cancellation.enable = "no"
    • ine.invitation.enable = "no"
    • service.admin.alarm = "no"

csmig Tips and Troubleshooting

The section describes the following tips and trouble shooting solutions:

 

The csmig dry run calendar owner is not the owner I want for a calendar

For example, a calendar named tchang:myCalendar has the owner as jsmith in the calendar database, and the csmig dry run shows the mapping as jsmith:tchang_myCalendar. I would like to keep this calendar name as tchang:myCalendar and assign the owner as tchang.

Solution

Before the migration, use the cscal utility to change the owner of the calendar tchang:myCalendar to tchang. Once this is done, the migration will map this calendar to tchang:myCalendar and add icsCalendarowned to tchang’s LDAP entry.

The LDAP calendar search doesn’t work correctly

After migration, the LDAP calendar search is enabled, but the calendar search dialog does not return any results or returns only partial results.

Solution

Enabling the LDAP calendar search allows Calendar Server to search (&(objectclass=icscalendaruser)(icscalendarowned=*substr*)).

Manually run two different searches on the LDAP data with the following filters and compare the output:

Since the server uses the filter that includes icsCalendaruser objectclass, the LDAP server might have been deployed with the schema check disabled, and some calendar entries may have been provisioned without the icsCalendaruser objectclass.

The csmig dry run indicates duplicate calendar names

The csmig dry run mapping file and output file indicate that there is a duplicate calendar name. For example, in the original database, jsmith owns the following calendars:

The dry run indicates that during a migration, the two calendars will be merged, and the resulting calendar will be

The output file will include the following warning message:

Error modifying calendar properties, error=2

Solution

If you don’t want the two calendars to be merged, change the owner of basketball to a user other than jsmith before the migration. This will preserve the data integrity of the two separate calendars.

How do I assign orphan calendars to different owners?

By default csmig assigns all orphan calendars to a single owner, but I would like to assign different owners for some orphan calendars.

Solution

csmig doesn’t accept the mapping file in the command line. However, you can assign owners to the orphan calendars in the original database before the migration. Check the dry run mapping file for all orphan calendars. Then use the cscal utility to assign owners to the orphan calendars before the migration. Run csmig in dryrun mode again to verify the new owners.

How do I move calendar users to another back-end server?

How do I move users from one back-end server to another?

Solution

To move a calendar user, you export each of the user’s calendars on the original server and then import the calendars on the second server. After the calendars are moved, you can delete the calendars on the original server. For detailed steps about moving users, see the Sun Java System Calendar Server 6 2004Q2 Administration Guide.


csvdmig

The csvdmig utility modifies the Calendar Server database and LDAP directory server database for sites that want to use hosted (virtual) domains. The csvdmig utility adds the domain name to the user ID as follows:

csvdmig Syntax

The csvdmig utility has the following syntax:

csvdmig [-t DestinationDB] [-c ConfigFile] [-e ErrorFile] [-m MappingFile]
  migrate [DB | LDAP]

-m MappingFile is an input parameter that specifies a mapping file. The default is MigrateMapping.

The mapping file is an input text file that maps existing users to their respective domains. You must create the mapping file before you run csvdmig. Specify one entry per line with a space between the old and new values. For example:

user1 user1@sesta.com
user2 user2@siroe.com
user3 user3@sesta.com
...
user-n user-n@siroe.com

-c ConfigFile is an input parameter that specifies a Calendar Server configuration file. The default is the ics.conf file.

-t DestinationDB is an output parameter that specifies the location of the migrated database. The default is MigratedDB.

-e ErrorFile is an output parameter that specifies the name of the error file for errors that cannot be resolved. The default is MigrateError.

DB | LDAP specifies whether to modify the Calendar Server database (DB) or the LDAP directory server (LDAP). The default is the calendar database (DB).

csvdmig Examples



Previous      Contents      Index      Next     


Copyright 2004 Sun Microsystems, Inc. All rights reserved.