Sun logo      Previous      Contents      Index      Next     

Sun ONE Calendar Server 6.0 Administrator's Guide

Chapter 6
Backing Up and Restoring Calendar Server Data

To back up and restore Calendar Server data in the /var/opt/SUNWics5/csdb directory, use these command-line utilities:

This chapter includes these sections:


Backing Up Calendar Server Data

The csbackup utility can back up the calendar database, a specified calendar, or a user’s default calendar. This section describes:

Backing Up the Calendar Database to a Directory

To backup the calendar database to a target backup directory, use the csbackup utility database command. For example, to back up the calendar database to a directory named backupdir:

csbackup -f database backupdir

The ics50caldb.conf version file in the backup directory shows the version number of the calendar database that was backed up.


Note

The csbackup utility fails if the target backup directory already exists and you do not specify the -f option. For example, the following command fails if backupdir exists, even if the directory is empty:

csbackup database backupdir

Therefore, if you specify a target backup directory that already exists, include the -f option when you run csbackup.

You can also specify a non-existent target backup directory and let csbackup create the directory for you.


Backing Up a Specific Calendar to a File

csbackup -c JSmithcal calendar jsmith.xml

To backup a calendar to a backup file in iCalendar or XML format, use the csbackup utility calendar command. The file-name extension (.ics or .xml) of the backup file indicates the format.

For example, to backup the calendar JSmithcal in iCalendar format (text/calendar MIME) to the file jsmith.ics in the backupdir directory:

ccbackup -c JSmithcal calendar backupdir/jsmith.ics

Or, to backup the calendar JSmithcal in XML format (text/XML) to the file jsmith.xml in the bcakupdir directory:

ccbackup -c JSmithcal calendar backupdir/jsmith.xml

Backing Up a User’s Default Calendar to a File

To back up a user’s default calendar to a text file in iCalendar or XML format, use the csbackup utility defcal command. The file-name extension (.ics or .xml) that you specify for the output file determines which format is used.

For example, to back up calendar user JSmith’s default calendar in iCalendar (text/calendar MIME) format to a file named jsmith.ics:

csbackup -a JSmith defcal jsmith.ics

Or, to back up calendar user JSmith’s default calendar in XML (text/xml MIME) format to a file named jsmith.xml:

csbackup -a JSmith defcal jsmith.xml


Restoring Calendar Server Data

The csrestore utility restores the calendar database, individual calendars, or a user’s default calendar that was saved using csbackup. You must run the csrestore utility on the local machine where Calendar Server is installed, and you must first stop Calendar Server. (Calendar Server can be running, however, when you backup the database.)

This section describes:

Restoring the Calendar Database

To restore a calendar database that was saved to a backup directory using the csbackup utility, use the csrestore utility database command.

For example, to restore the calendar database that was saved to a backup directory named backupdir:

csrestore database backupdir

Restoring a Calendar From a Backup Directory

To restore a specific calendar from a database that was saved to a backup directory using the csbackup utility, use the csrestore utility database command with the -c option.

For example, to restore the calendar JSmithcal from the backup database directory backupdir:

csrestore -c JSmithcal calendar backupdir

Restoring a Calendar From a File

To restore a specific calendar that was saved to a backup file using the csbackup utility, use the csrestore utility calendar command with the -c option. The file-name extension (.ics or .xml) of the backup file indicates the format in which the calendar was saved.

For example, to restore the calendar JSmithcal that was saved in iCalendar (text/calendar MIME) format to the file jsmith.ics located in the backupdir directory:

csrestore -c JSmithcal calendar backupdir/jsmith.ics

Or, to restore the calendar JSmithcal that was saved in XML (text/calendar MIME) format to the file jsmith.xml located in the bcakupdir directory:

csrestore -c JSmithcal calendar backupdir/jsmith.xml

Restoring a User’s Default Calendar

To restore a a user’s default calendar that was saved to a backup file using the csbackup utility, use the csrestore utility defcal command. The file-name extension (.ics or .xml) of the backup file indicates the format in which the calendar was saved.

For example, to restore calendar user JSmith’s default calendar that was saved in iCalendar (text/calendar MIME) format to a file named jsmith.ics located in the backup directory backupdir:

csrestore -a JSmith defcal backupdir/jsmith.ics

To restore calendar user JSmith’s default calendar that was saved in XML (text/xml MIME) format to a file named jsmith.xml located in the backup directory backupdir:

csrestore -a JSmith defcal backupdir/jsmith.xml


Using Sun StorEdge Enterprise Backup™ or Legato NetworkerŽ

You can also use either Sun StorEdge Enterprise Backup software (formerly Solstice Backup) or Legato Networker to back up and restore Calendar Server data. The Sun StorEdge Enterprise Backup software and Legato Networker are similar, and the instructions in this section apply to both products.

Before attempting to backup Calendar Server, however, see the Sun StorEdge Enterprise Backup or Legato Networker documentation.

For the Sun StorEdge Enterprise Backup software documentation, see http://docs.sun.com.

This section describes:

Calendar Server Backup/Restore Files

Calendar Server provides these files in the /opt/SUNWics5/cal/sbin directory to use with the Sun StorEdge or Legato backup software:

 

Backing Up Calendar Server Data Using Sun StorEdge Enterprise Backup software or Legato Networker

To backup the calendar database using the Sun StorEdge or Legato backup software:

  1. Copy the Sun StorEdge or Legato nsrfile binary file to the /usr/lib/nsr directory.
  2. Create these symbolic links in the /usr/lib/nsr directory:
  3. icsasm -> /opt/SUNWics5/cal/sbin/icsasm
    nsrfile -> /usr/lib/nsr/nsrfile

  4. Change to the /opt/SUNWics5/cal/sbin directory and run the csbackup utility with the -l option. For example:
  5. cd /opt/SUNWics5/cal/sbin
    ./csbackup
    -l

    The the -l option creates a backup directory image under the current directory. The files in this directory are empty and are used only to provide information to the backup program about how calendars will be stored on the backup media. If the backup directory already exists, it is synchronized with the current directory structure.

  6. Use the save command to back up calendar data. For example:
  7. /usr/bin/nsr/save -s /opt/SUNWics5/cal/sbin/budir

    You can also use the Sun StorEdge or Legato backup GUI to schedule backups by setting up a client saveset to periodically backup the database.

    Notes Do not modify the .nsr files. These generated files contain directives that are interpreted by the save command and the icsasm ASM during the backup process.

    Calendar Server does not support the incremental backup feature. Do not use this feature because the backup directory is only an image of the folder structure and contains no actual data.

    You cannot backup a calendar with a name that contains non-ASCII characters or the forward slash (/).

     

  8. Automate the backup procedure.
  9. The preceding steps describe how to run a backup manually. It is recommended that you set up the backup program’s backup command to run the Calendar Server csbackup command-line utility before the running the backup program’s save command to achieve an automated backup process.

Restoring Calendar Server Data Using Sun StorEdge Enterprise Backup software or Legato Software

To restore Calendar Server data:

  1. Use the Sun StorEdge Enterprise Backup software nwrestore feature or the recover command to restore backed-up calendar information. If you use nwrestore, you receive the message:
  2. "File already exists. Do you want to overwrite, skip, backup, or rename?"

  3. Choose overwrite.
  4. This message appears because the backup tree is just the directory hierarchy. That is, it consists of empty files and stays that way permanently.



Previous      Contents      Index      Next     


Copyright 2003 Sun Microsystems, Inc. All rights reserved.