Product Documentation

Performing Backup and Restore Operations

May 27, 2015

You can back up Citrix Command Center appliance data and configurations either periodically to keep historical data or when upgrading Command Center software. Citrix recommends storing a copy of the backup on external storage media which can later be used to restore the backed up data.

Database Backup

You can schedule or perform an immediate backup of the database on the Command Center appliance. By default, backup is scheduled for midnight Saturday. The default directory for the backup is /var/lib/mysql/backup. Citrix recommends storing a copy of the backup on external storage media.

To backup a database by using the graphical user interface

  1. In a Web browser, type the IP address of the Command Center appliance. For example: https://10.102.31.69:8443/
  2. In User Name and Password, type the administrator credentials. The defaults are root and public, respectively.
  3. In the Menu bar, click Administration.
  4. Under Tools, click Backup.
  5. Do one of the following:
    • To schedule a backup, click Schedule Backup, and perform steps 6 and 7.
    • To start a backup immediately, click OK. After the backup is completed, the complete path to the backup file name is displayed.
  6. Under Schedule Backup, use the following set of options to define your backup schedule:
    • Day(s) of Week—Specify the days on which you want to schedule the backup process. To select more than one day, hold down the Ctrl key while clicking the days.
    • Day(s) of month— Select this option to schedule a backup during a range of dates. For example, if you want to schedule a backup every day between 10th and 20th of every month, type 10-20.
    • Daily—Select this option to run the backup process every day.
    • Scheduled Hours—Specify the time(s) at which to schedule the backup process, as hours in a 24-hour day. Use commas to separate multiple hours (for example, 12, 2, 4).
  7. Click OK. The schedule is saved.

To backup a database by using the command line

  1. On a workstation or laptop, open an SSH connection to the appliance by using an SSH client, such as PuTTY.
  2. Log on to the appliance, using the administrator credentials. In User Name and Password, type the administrator credentials. The defaults are root and public, respectively.
  3. Stop the Command Center software. At the shell prompt, type:

    ./etc/init.d/NSCCService stop
  4. Change directory to /opt/Citrix/Citrix_Command_Center/bin. Then, at the shell prompt, type:

    sh BackupDB.sh
  5. Start the Command Center software. At the shell prompt, type:

    ./etc/init.d/NSCCService start

Restoring the Data

The backup process creates a directory whose name begins with BackUpMMDD_XXX. By default, the directory is a subdirectory of the /var/lib/mysql/backup directory. The directory contains a number of .data files. The restore operation may several minutes to complete. Stop the Command Center software before restoring the data. After the restore is complete, restart the Command Center software.
Caution: When restoring the data, the current data on the appliance is deleted.

To restore the data

  1. On a workstation or laptop, open an SSH connection to the appliance by using an SSH client, such as PuTTY.
  2. Log on to the appliance, using the administrator credentials. In User Name and Password, type the administrator credentials. The defaults are root and public, respectively.
  3. Stop the Command Center software. At the shell prompt, type:

    ./etc/init.d/NSCCService stop
  4. Change directory to /opt/Citrix/Citrix_Command_Center/bin. Then, at the shell prompt, type:

    sh RestoreDB.sh <path to the directoryname in which to restore data>
  5. Start the Command Center software. At the shell prompt, type:

    ./etc/init.d/NSCCService start

Restoring the Data on an External Appliance

Updated: 2015-05-28

A backup of the database is stored by default on the Command Center appliance. You can also store a backup of the database on an external appliance and generate reports from that database. Before you can generate reports, you must install MySQL software on the external appliance, create a database, restore the backed up files, and install the same version of Command Center software that is installed on the Command Center appliance.

Prerequisites

Before you restore the backed up files on the external appliance, verify the following:
  1. You are running a supported version of the Linux operating system. The following versions are supported:
    • Red Hat Enterprise Linux AS 4.0
    • Red Hat Enterprise Linux ES 4.0 and 5.1
    • Red Hat Enterprise Linux ES 5.1 64-bit edition
    • CentOS 4.0 and 5.1
  2. A minimum of 2GB RAM is available.

To restore the data on an external appliance

  1. Install MySQL 5.1.48 on the external appliance. At the shell prompt, type the following commands:

    rpm -i MySQL-server-enterprise-5.1.48-1.rhel5.x86_64.rpm

    rpm –i MySQL-client-enterprise-5.1.48-1.rhel5.x86_64.rpm

    This operation may take a few minutes.

  2. Set the administrator password. At the shell prompt, type:

    /usr/bin/mysqladmin –uroot password <mypassword>

    where <mypassword> is the new password.

  3. Connect to the MySQL client and create a database named cmdctr. At the prompt, type:

    create database cmdctr;

  4. Copy the backed up files under /var/lib/mysql/backup/<directoryname> on the Command Center appliance to the external appliance by using a secure file transfer utility, such as SFTP.
  5. Restore each file on the external appliance. At the shell prompt, type:

    gunzip < $[<filename.gz file] | /usr/bin/mysql -u root –p[PASSWORD] cmdctr

    Repeat this command for each of the other files that are backed up.

  6. Install Command Center on the external appliance. The version of Command Center software should be the same version that is running on the Command Center appliance. When prompted to start Command Center, select No.
  7. Copy the configuration folder in the backed up files to the directory in which Command Center is installed on the external appliance. The default directory is /opt/Citrix/Citrix_Command_Center. Copying the folder ensures that your settings, such as alert filters, event filters, threshold, event severity, failover and security settings, on the Command Center appliance are available on the external appliance.
  8. Start the Command Center software. The restore is now complete.

Example

The following commands are an example of performing steps 1–5 of the above procedure. For information about installing Command Center, see Installing the Command Center Server on Linux.

#rpm -i MySQL-server-enterprise-5.1.48-1.rhel5.x86_64.rpm 
#rpm –i MySQL-client-enterprise-5.1.48-1.rhel5.x86_64.rpm 
#/usr/bin/mysqladmin –uroot password pass1 
#mysql –uroot –ppass1 
mysql> create database cmdctr; 
mysql> exit; 
# sftp root@10.102.31.69 
Connecting to 10.102.31.69... 
root@10.102.31.69's password: 
sftp> cd /var/lib/mysql/backup/CCBackUp_JUN30_2011_11_35 
sftp> mput *.gz 
sftp> bye 
# gunzip< file1.gz> | /usr/bin/mysql -u root –ppass1cmdctr 
# gunzip< file2.gz> | /usr/bin/mysql -u root –ppass1cmdctr 
… 
… 
…