On an NSM 11.2 unix manager box, how can I export the calendar definitions from the postgres database?

Document ID : KB000049370
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

How can I export the calendar definitions from the postgres database to import them on another NSM unix box.

Solution:

There is no NSM calendar backup utility available on Unix platforms. The "caldb" utility that can back up calendars on Windows platforms is not available on Unix platforms. Instead, calendar database needs to be exported to a file using the database utilities.

Steps to export calendar database to a file:

  1. Login to the server using the root credentials.
  2. Make sure postgres server is running.
  3. su - postgres
  4. pg_dump -i -a -table=cal -U mdbadmin -f data_cal_tbl.sql mdb
  5. The command in step 4 will generate file data_cal_tbl.sql in the current directory ($CASHCOMP/pgsql) containing all the calendar data.

The "data_cal_tbl.sql" file can, later, be used to import calendars on the same or different unix server:

  1. Login to the server using the root credentials.
  2. Make sure postgres server is running
  3. Copy the file data_cal_tbl.sql to the $CASHCOMP/pgsql directory.
  4. Make sure calendar database does not contain the same calendar IDs that are going to be imported. If a calendar with the same ID already exists in the database, the import will fail. In such case, the calendars in the database will need to be either deleted or renamed using the "cautil" commands. For example, to rename a calendar in the database, use the following command:

    cautil alter cal id=old_id new=new_id
  5. su - postgres
  6. psql -f data_cal_tbl.sql mdb
  7. Exit (to return root)
  8. After completing the import process, run the "caladmin -r" command to refresh the active calendar list.