Steps for Data Restore activity


Restoring data backed up with DNIF is really easy. For the sake of this example, we’ll restore the tar file backed up in our help documentation, namely, backup_data-09_10_2017_120939.tar.gz.

Restoring from a backup can be achieved in two ways:

  • Restore from a backed up tar file.

  • Restore from a remote server with rsync over ssh.

Note: Reverse-sync the remote backup i.e. using the steps given in Backing up Data help page, rsync over ssh section.

It is important to stop all services on Data Store or A10 before proceeding to restore backup data.

Stop running services on running dnif-container

It is important to stop all running services in order to halt Input-Output operations related to the data-store before initiating the restoration activity.

  1. Login to your Data Store or A10 container. Read more on how to login to the docker container.

  2. Execute the given command to stop all running services.

    $supervisorctl stop all
    

    The supervisorctl command brings all running dnif-services to halt.

    Here’s what your output should look like.

     [email protected]:~# supervisorctl stop all
     importstore: stopped
     dataprocessor:dataprocessor_03: stopped
     ilicrscheduler: stopped
     din: stopped
     config_reporter: stopped
     datastoreapi: stopped
     dataprocessor:dataprocessor_02: stopped
     dataprocessor:dataprocessor_01: stopped
     dataprocessor:dataprocessor_04: stopped
     syslog_listerner_udp: stopped
     events_parser_processor: stopped
     notifemail: stopped
     ilidsapi: stopped
     ilicrapi: stopped
     agent79: stopped
     syslog_listerner_tcp: stopped
     sshd: stopped
     nameserver: stopped
     celeryds: stopped
     celerycr: stopped
     [email protected]:~#
    

Restore from a backup tar file:

  1. Copy both data and config backup files back into the host machine. (eg.: backup_data-dd_mm_yyyy_HHMMSS.tar.gz and backup_config-dd_mm_yyyy_HHMMSS.tar.gz)

  2. Extract the tar backup_data file into the volume folder path.
      $tar -xzvf  ./backup_data-dd_mm_yyyy_HHMMSS.tar.gz -C /path/to/vol/Your-Deployment-Key/
    

    Example:

      $tar -xzvf  ./backup_data-09_10_2017_120939.tar.gz -C /home/ATEN/CnxxxxxxxxxxxxV8/
    

    Here, backup_data-09_10_2017_120939.tar.gz is a data-backup file created as we saw in the Backing up Data help page document and /home/ATEN/CnxxxxxxxxxxxxV8/ is a dnif-container volume path mounted on the host machine.

  3. Extract the tar backup_config file into the volume folder path.
      $tar -xzvf  ./backup_config-dd_mm_yyyy_HHMMSS.tar.gz -C /path/to/vol/Your-Deployment-Key/
    

    Example:

      $tar -xzvf  ./backup_config-26_09_2017_161108.tar.gz -C /home/ATEN/CnxxxxxxxxxxxxV8/
    

    Note: It is important to extract the backup_data prior to backup_config, as extracting configuration will overwrite the file hash back to the /data folder. Note that doing this step in reverse or skipping this step may result in errors while starting important services.

Restore from remote server:

To resynchronize the /data folder back to dnif-container from the ssh-enabled backup server, we can use rsync over ssh to pull backup data.

  1. Login to your Data Store or A10 container. How to Login in docker container

  2. Move to the /dnif/<Deployment-key/ folder path.
      $cd /dnif/CnxxxxxxxxxxxxV8/
    
  3. To copy all files from the remote machine to the ./data folder, use this command:
      $rsync -v -r -e ssh --progress [email protected]:/var/tmp/data/ ./data/
    

    Example with Output:

     [email protected]:/dnif/CnxxxxxxxxxxxxV8# rsync -v -r -e ssh --progress
     [email protected]:/var/tmp/data ./
    
     [email protected]'s password:
     sending incremental file list
     ./
     DNIF/
     DNIF/nodes/
     DNIF/nodes/0/
     DNIF/nodes/0/node.lock
               	0 100%	0.00kB/s	0:00:00 (xfr#2, to-chk=151/157)
     DNIF/nodes/0/_state/
     DNIF/nodes/0/_state/global-1
              	67 100%	1.72kB/s	0:00:00 (xfr#3, to-chk=148/157)
     DNIF/nodes/0/indices/ctdp_conf/0/_state/state-2
              	39 100%	0.98kB/s	0:00:00 (xfr#4, to-chk=138/157)
     DNIF/nodes/0/indices/ctdp_conf/0/index/
     DNIF/nodes/0/indices/ctdp_conf/0/index/segments.gen
              	36 100%	0.90kB/s	0:00:00 (xfr#5, to-chk=137/157)
     ------- snipped -----
     sent 962,800 bytes  received 10,877 bytes  92,731.14 bytes/sec
     total size is 1,890,091  speedup is 1.94
     [email protected]:/dnif/CnxxxxxxxxxxxxV8#
    
  4. Copy config backup file back into the host machine.(eg: backup_config-dd_mm_yyyy_HHMMSS.tar.gz)

  5. Extract the tar backup_config file into the volume folder path that is mounted to the dnif-container.
      $tar -xzvf  ./backup_config-dd_mm_yyyy_HHMMSS.tar.gz -C /path/to/vol/Your-Deployment-Key/
    

    Example:

      $tar -xzvf  ./backup_config-26_09_2017_161108.tar.gz -C /docker-compose/ATEN/CnxxxxxxxxxxxxV8/
    

Note: Just like Step-3 from the Restore from Backup tar file , it is important to extract backup_config after copying the /data folder from the remote server. Note that doing this step in reverse or skipping this step may result with errors while starting important services.