Older versionVersion 2.7 SolutionsServer configuration backup

Server configuration backup

This document describes the automatic configuration backup in PhenixID Server.

The reader of this document should have some basic knowledge about PhenixID Server.

System requirements

PhenixID Server 2.4 or later

Overview

PhenixID Server configuration is stored in config/phenix-store.json. By default this file is backed up every night at 02:00 and saved for 7 generations.

Backups are stored in directory config/backups/<timestamp>/

Actual backup is performed by a pipe started by the built-in scheduler. All configuration is created automatically on first server start and bound to the local node.

Scheduler

The scheduler is responsible for executing the backup at specified time. Scheduling requires the scheduler module to be running on the local node. Scheduler jobs are stored in configuration section SCHEDULES.

Schedule execution is configured using a cron like syntax using 6 or 7 whitespace separated fields

Field Name Mandatory Allowed Values Allowed Special Characters
Seconds YES 0-59 , - * /
Minutes YES 0-59 , - * /
Hours YES 0-23 , - * /
Day of month YES 1-31 , - * ? / L W
Month YES 1-12 or JAN-DEC , - * /
Day of week YES 1-7 or SUN-SAT , - * ? / L #
Year NO empty, 1970-2099 , - * /

For more information on the cron syntax see: http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html

Example schedule for node 'demo':

{
  "id" : "demo_backup",
  "description" : "Auto generated schedule for backing up server config. Runs by default 02:00 every night.",
  "enabled" : "true",
  "boundToNode" : "demo",
  "cronSyntax" : "0 0 2 * * ? *",
  "pipeid" : "demo_backup"
}

Backup pipe

The backup pipe executes the actual file backup using the FileBackupValve.

FileBackupValve properties:

  • path: path and file name of file to backup
  • count: number of backup generations to keep

Note: A FileBackupValve can only backup one single path/file. To backup more than one path/file, add a FileBackupValve for each path/file to the pipe.

Example backup pipe for node 'demo':

{
  "id" : "demo_backup",
  "description" : "Auto generated pipe for backing up server config",
  "valves" : [ {
    "name" : "FileBackupValve",
    "config" : {
      "path" : "./config/phenix-store.json",
      "count" : "7"
    }
  } ]
}

Cluster support

Backup is compatible with clustering since each node defines its own backup configuration bound to that specific node using cluster unique ids containing the node name/id. Schedule is also bound to the node using the boundToNode property, limiting execution to the specified node.