storage Configuration File

storage Configuration File

Location: /batm/config/storage

The storage configuration file is optional and may not exist on your server. This article is intended to describe the contents of this file if it exists or you choose to store your image data off-server.

Configuration instructions for using Amazon S3 storage are provided below.

When the default internal storage is changed, it only affects the following items:

  • identity documents,

  • camera captures, and

  • fingerprints.

The remaining data items/folders will continue to be stored locally.


provider=local access_key={your access key} secret_key={your secret key} region={aws region of the bucket} bucket={your bucket} endpoint_url={optional for supporting alternatives such as MinIO S3 etc}
  1. provider: can currently be either [s3] or [local].

  2. access_key: the API or access key to remotely access the selected provider’s storage.

  3. secret_key: the secret key to remotely access the selected provider’s storage.

  4. region: the data storage center that contains your bucket or remote drive.

  5. bucket: the S3 bucket name you created.

  6. endpoint_url: (optional) where required, delete the entire line if unused.


Amazon S3 Instructions

With CAS version 20260601+ Operators can now migrate files from local storage to AWS S3. Depending on the amount of your data and your internet speed, it may take some time (hours -> days), so block out sufficient time before beginning.

A) Setup your bucket at AWS

  1. Create an account and bucket at Amazon: https://aws.amazon.com/s3/

image-20260622-150325.png

Note the bucket region that you selected during creation:

image-20260622-145905.png

Note the name you created for the bucket:

image-20260622-150714.png
  1. Create the required API access keys at AWS.

  • Navigate to: Identity and Access Management (IAM) > My security Credentials

  • Click “Create access key” to view the Access key and Secret Key required next.

B) Configure your CAS host from the console

Install AWS-CLI

Install AWS CLI on the server, e.g.:

snap install aws-cli --classic

Configure CAS

Create the storage file at config:

sudo nano /batm/config/storage

Enter these S3 credentials for the initial transfer:

provider=local access_key={your access key} secret_key={your secret key} region={aws region of the bucket} bucket={your bucket}

Initiate the migration from the CAS host console

  1. Bulk upload (server online — server keeps running, takes hours or days on large datasets)

sudo /batm/batm-migrate-to-s3 sync

Uploads all files from the four identity locations to S3. Safe to interrupt and resume. Run repeatedly – each pass only uploads what's new since the last run. It uses aws s3 sync internally, it’s possible to tweak the upload parameters - https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html

Check the status of the migration (as/if needed) using:

sudo /batm/batm-manage migrate-to-s3 status
Screenshot from 2026-06-16 14-29-34.png
  1. Repeat until delta is small (server online)

Re-run sync until two consecutive passes complete in under a minute or relatively fast. This drains the backlog written by the live server during step 1.

  1. Final sync + switchover

Your CAS server will be down for a brief period.

Shutdown CAS:
sudo /batm/batm-manage stop all
Perform the final migration:
sudo /batm/batm-migrate-to-s3 sync # final delta — no concurrent writes sudo /batm/batm-migrate-to-s3 verify # optional: confirm all files are in S3
Change the provider setting in the storage file:
sudo nano /batm/config/storage
  • Change provider=local to: provider=s3

Finally, start CAS:
sudo /batm/batm-manage start all
  1. Verify by opening a recent customer identity record in the admin UI — documents and photos must render.

  • Local files are untouched throughout the migration — you can remove /batm/data/[documents|capture|fingerprints_*] later when you’re confident that the files have fully and successfully migrated to the S3 bucket.


Rollback

If you decide to remove the AWS bucket as the storage destination, make the following changes.

  1. Stop all CAS services,

  2. change provider back to local,

  3. start services.

NOTE: after the initial switch, new files are written to the S3 bucket directly with no local backup, so a rollback after that point would require you to copy the data from your bucket back to the CAS host.

  1. Sync the new files currently on S3 back to local using the AWS CLI sync function.

  2. There is currently no scripted support for this case.

  3. The Identity files submitted by the newest customers will be unavailable until that sync finishes.

Copyright © 2020-2026 General Bytes USA LLC