Biometric Database Backup and Restore

There are 3 galleries in the Tarantool-based biometric database:

  • ffsec_dossier_face: biometric samples extracted from dossier photos.
  • ffsec_events: biometric samples extracted from faces in video.
  • ffsec_monitoring: biometrics samples from all dossiers under watch (active).

The backup/restore functionality allows you to fully restore all these galleries whenever needed.

To avoid data loss, we recommend you to create a backup at least once a week. Overall, the frequency of backups depends on the amount of dossiers and face recognition events, as well as available disk space.

Be sure to backup the database before migrating your system to another biometric model.

In this section:

Utilities

To backup and restore the FindFace Security biometric database, the following utilities are needed:

  1. backup: findface-storage-api-dump,
  2. restore: findface-storage-api-restore.

These utilities are automatically installed along with findface-sf-api.

Backup Database

To backup the biometric database, use the findface-storage-api-dump utility as follows:

Important

The following services have to be active: findface-tarantool-server, findface-sf-api.

Note

The backup functionality can be applied to a distributed database. In this case, the findface-storage-api-dump utility will backup galleries on all the shards specified in /etc/findface-sf-api.ini.

  1. On the server with findface-sf-api, create a directory to store the backup files.

  2. From this directory, launch the findface-storage-api-dump utility by executing:

    sudo findface-storage-api-dump -config /etc/findface-sf-api.ini
    

    The utility will backup at once all the galleries into the files with corresponding names ffsec_dossier_face.json, ffsec_events.json, ffsec_monitoring.json, and save them into the directory. These files contain all the data needed to restore the entire database.

Restore Database

To restore the biometric database from the backup, do the following:

  1. Use HTTP API to create initial galleries in the database: ffsec_dossier_face, ffsec_events, ffsec_monitoring.

    Tip

    See HTTP API.

    curl -D - -X POST -s 'http://localhost:8101/v2/galleries/add/ffsec_dossier_face'
    curl -D - -X POST -s 'http://localhost:8101/v2/galleries/add/ffsec_events'
    curl -D - -X POST -s 'http://localhost:8101/v2/galleries/add/ffsec_monitoring'
    
  2. From the directory with the backup files, launch the findface-storage-api-restore utility for each gallery at a time:

    sudo findface-storage-api-restore -config /etc/findface-sf-api.ini < ffsec_dossier_face.json
    sudo findface-storage-api-restore -config /etc/findface-sf-api.ini < ffsec_events.json
    sudo findface-storage-api-restore -config /etc/findface-sf-api.ini < ffsec_monitoring.json
    

    The restore process can be interrupted and resumed when necessary. To resume the process after interruption, simply launch the findface-storage-api-restore utility again.