Backup and restore of system data

To backup the SKYShell and the SQL, Mongo and LDAP databases, go to the SKYShell on the Com Node and type:

backup

You will see the following options:

			[comnode1.example.org](OK) 366: > backup
			Available sub-commands:
			now              Run the system backup now.
			enable           Enable automatic backup of database every second day.
			config           Get/Set Configuration
			disable          Disable automatic backup of database every second day.
			[comnode1.example.org](OK) 367: > restore
			Available sub-commands:
			file             Run the system restore from spesified file.
			[comnode1.example.org](OK) 368: >

		

You can either choose to backup immediately by typing:

backup now

or you can enable a backup every second day by typing:

backup enable

To restore the data from a file, type:

restore file <filename>

Currently this requires a manual procedure as follows:

  1. Shut down the Core Node / DB Node (whichever you are using in your deployment).
  2. Shut down the web server on the Win Node (so no new data gets pushed to the Com Node).
  3. Take a snapshot of the Com Node VM.
  4. Take a backup of the SQL Database.
  5. Start the Com Node VM.
  6. Start the web server on the Win Node.

The ability to backup the LDAP and MongoDB databases from the SkyShell will be available in a forthcoming version of Synergy Manage.

Backing up the LDAP and MongoDB databases

Currently this is done by taking a regular snapshot of the Virtual Machine running the Core Node/ DB Node.

Automating database backup

Optionally, you can create a cron job on the Core Node/ DB Node to automate regular backups of the databases. Note that while the backup is happening, the ComNode services will stop, so you will not be able to provision users, and users will not be able to log into CMS clients at this time. The backup duration depends on the size of your databases, but should not take more than 15 minutes. To create an automated backup cron job:

  1. Log into the Core Node/ DB Node via ssh.
  2. At the prompt, type exit to exit the SkyShell, then create a new backup file on the server by typing: nano /usr/local/bin/backup_cleanup.sh, then pressing Enter.
  3. Copy and paste the following into the nano file you have just created:

    #!/bin/sh

    #Modify this to keep older backup

    DAYS_TO_KEEP_BACKUP=5 /usr/bin/find /opt/backup/ -name '*.zip' -mtime +${DAYS_TO_KEEP_BACKUP} -delete

  4. Press ctrl+x, followed by y, then Enter, to save and quit.
  5. Make the script runnable by typing: chmod a+x /usr/local/bin/backup_cleanup.sh then pressing Enter.
  6. Create a new file that will setup the scheduled job by typing nano /etc/cron.d/ScheduledBackupJob.cron, then pressing Enter.
  7. Copy and paste the following into the nano file you have just created:

    # Backup Job

    SHELL=/bin/bash

    PATH=/sbin:/bin:/usr/sbin:/usr/bin

    # Backup every day at 22:00 UTC

    00 22 * * * root /opt/SkyShell/SkyShell --run="backup now" > /dev/null && /usr/local/bin/backup_cleanup.sh > /dev/null

    Ensure that the correct characters appear in the nano file, retype after the copy paste to correct any errors if necessary: > may appear as &gt; for example.

  8. Press ctrl+x, followed by y, then Enter, to save and quit.
  9. Type chmod 0644 /etc/cron.d/ScheduledBackupJob.cron then press Enter.
  10. Type systemctl restart crond then press Enter.

For more information on creating and scheduling cron jobs see Cron Wiki.

In the event that you need to restore from a backup, log a ticket with Synergy SKY support.

Optional: Moving backup files off the server

We recommend copying the backed up files from the server.

If you have a Linux/Unix host:

Use scp to copy recursively all files from the backup directory to the host machine's local directory /backup_directory/comnode using this command:

scp -r root@cobra-comnode.int.synergysky.com:/opt/backup/ /backup_directory/comnode

If you have a Windows host:

Use WinSCP to copy the files off the ComNode. To script this see: WinSCP scripting.

Note: Setting keyless ssh authentication is recommended if automating the backup file copy. For more details see: setting keyless authentication.

Backing up the Microsoft SQL database

To create a maintenance plan using the Maintenance Plan Wizard in Object Explorer:

  1. Click the plus sign to expand the server where you want to create a maintenance plan.
  2. Click the plus sign to expand the Management folder.
  3. Right-click the Maintenance Plans folder and select Maintenance Plan Wizard.
  4. Follow the steps of the wizard to create a maintenance plan.

    For more information, see Use the Maintenance Plan Wizard.

To create a maintenance plan using the design surface in Object Explorer:

  1. Click the plus sign to expand the server where you want to create a maintenance plan.
  2. Click the plus sign to expand the Management folder.
  3. Right-click the Maintenance Plans folder and select New Maintenance Plan.
  4. Create a maintenance plan following the steps in Create a Maintenance Plan (Maintenance Plan Design Surface).