Configuration

DBacked configuration is made to be adaptable to a lot of different scenarios. It should be easy to integrate DBacked in your existing system.

There is three sources of configuration (from highest to lowest priority):

  • Command line arguments CLI
  • Environment variables ENV
  • Configuration file CFG

Every following configuration can be provided through these means. The configuration file default location is /etc/dbacked/config.json but can be changed with --config-file-path command line argument.

Some configuration are only used for the free DBacked version and other for the Pro DBacked service. They will be ignored if specified and not useful.

Agent config

  • Subscription type: can be free or pro
    • Optionnal Default: free
    • --subscription-type free CLI
    • DBACKED_SUBSCRIPTION_TYPE=free ENV
    • "subscriptionType": "free" CFG
  • Agent ID: Used when multiple instances of DBacked are launched to identify which made the backup
    • Optionnal
    • --agent-id awesome-agent CLI
    • DBACKED_AGENT_ID=awesome-agent ENV
    • "agentId": "awesome-agent" CFG
  • Database tools download directory: where to download tools like pg_dump and mongorestore
    • Optionnal Default: /tmp/dbacked
    • --database-tools-directory /tmp/dbacked CLI
    • DBACKED_DATABASE_TOOLS_DIRECTORY=/tmp/dbacked ENV
    • "databaseToolsDirectory": "/tmp/dbacked" CFG
  • DBacked Pro API key: Used to identify to DBacked servers when using pro version
    • DBacked PRO
    • --apikey thisismyapikey CLI
    • DBACKED_APIKEY=thisismyapikey ENV
    • "apikey": "thisismyapikey" CFG
  • Email: Used to send you an alert if no backups have been made in the last 30 days, if you don't give an email, no beacon will be sent to the DBacked servers, for more information, look at the corresponding documentation
    • DBacked FREE Optionnal
    • --email john@gmail.com CLI
    • DBACKED_EMAIL=john@gmail.com ENV
    • "email": "john@gmail.com" CFG
  • Backup schedule: When to backup the database, should be a cron expression. Use 0 0 * * * to backup everyday at midnight. For more information look at Crontab.guru.
    • DBacked FREE Required
    • --cron "0 0 * * *" CLI
    • DBACKED_CRON="0 0 * * *" ENV
    • "cron": "0 0 * * *" CFG

Security config

  • Public Key: The RSA public key as a PEM to use to encrypt your backups, recommended length is 4096bits. DBacked can create one for you during the interactive install. If you are using DBacked Pro, the agent will fetch the key from the servers but you can specify it to be sure no backups will be encrypted with another key than your own.
    • Required
    • --public-key XXXXX CLI
    • DBACKED_PUBLIC_KEY=XXXXX ENV
    • "publicKey": "XXXXX" CFG

AWS S3 config

This config is only used for DBacked free. It will be ignored if you are a DBacked Pro user.

The access key and secret should have enough privileges to create and list backups. Look at the S3 documentation for more information.

  • S3 Access Key ID:
    • DBacked FREE Required
    • --s3-access-key-id XXXXX CLI
    • DBACKED_S3_ACCESS_KEY_ID=XXXXX ENV
    • "s3accessKeyId": "XXXXX" CFG
  • S3 Secret Access Key:
    • DBacked FREE Required
    • --s3-secret-access-key XXXXX CLI
    • DBACKED_S3_SECRET_ACCESS_KEY=XXXXX ENV
    • "s3secretAccessKey": "XXXXX" CFG
  • S3 Region: Should be a valid AWS S3 region
    • DBacked FREE Required
    • --s3-region eu-west-1 CLI
    • DBACKED_S3_REGION=eu-west-1 ENV
    • "s3region": "eu-west-1" CFG
  • S3 Bucket Name: This bucket needs to be created before
    • DBacked FREE Required
    • --s3-bucket test-bucket CLI
    • DBACKED_S3_BUCKET=test-bucket ENV
    • "s3bucket": "test-bucket" CFG

Database config

  • Database type: can be pg, mysql or mongodb
    • Required
    • --db-type pg CLI
    • DBACKED_DB_TYPE=pg ENV
    • "dbType": "pg" CFG
  • Database connection string: Only for MongoDB, look at the documentation on the MongoDB website for more information
    • MongoDB Only Required
    • --db-connection-string mongodb://db1.example.net:27017/prod CLI
    • DBACKED_DB_CONNECTION_STRING="mongodb://db1.example.net:27017/prod" ENV
    • "dbConnectionString": "mongodb://db1.example.net:27017/prod" CFG
  • Database Host: Can be a hostname or an IP address
    • PostgreSQL and MySQL Only Required
    • --db-host localhost CLI
    • DBACKED_DB_HOST="localhost" ENV
    • "dbHost": "localhost" CFG
  • Database Port:
    • PostgreSQL and MySQL Only Optionnal
    • --db-port 5432 CLI
    • DBACKED_DB_PORT="5432" ENV
    • "dbPort": "5432" CFG
  • Database Username:
    • PostgreSQL and MySQL Only Optionnal
    • --db-username backup CLI
    • DBACKED_DB_USERNAME="backup" ENV
    • "dbUsername": "backup" CFG
  • Database Password:
    • PostgreSQL and MySQL Only Optionnal
    • --db-password secretpassword CLI
    • DBACKED_DB_PASSWORD="secretpassword" ENV
    • "dbPassword": "secretpassword" CFG
  • Database Name:
    • PostgreSQL and MySQL Only Required
    • --db-name prod CLI
    • DBACKED_DB_NAME="prod" ENV
    • "dbName": "prod" CFG
  • Database Alias: Used in backups files names, by default it's the database name
    • PostgreSQL and MySQL Only Optionnal
    • --db-alias staging CLI
    • DBACKED_DB_ALIAS="staging" ENV
    • "dbAlias": "staging" CFG

Misc

  • Dumper Options: Additionnal arguments to provide to pg_dump, mysqldump or mongodump
    • Optionnal
    • --dumper-options "--no-privileges" CLI
    • DBACKED_DUMPER_OPTIONS="--no-privileges" ENV
    • "dumperOptions": "--no-privileges" CFG
  • Send analytics: Send anonymous analytics to our servers to help us improve DBacked. Would be much appreciated! 😃 For more information about what's sent and when, look at the related section on the Security page.
    • Optionnal Default: false
    • --send-analytics CLI
    • DBACKED_SEND_ANALYTICS="true" ENV
    • "sendAnalytics": true CFG
  • Daemon: Daemonize the agent, detaching it from the current session. It will check if another daemon is already running before daemonizing
    • Optionnal Only with start-agent command
    • --daemon CLI
    • DBACKED_DAEMON="true" ENV
    • "daemon": true CFG
  • Daemon Name: Use another name to daemonize the agent, useful when you want multiple instances of DBacked to be daemonized at the same time (for multiple databases)
    • Optionnal Only with start-agent command
    • --daemon-name staging CLI
    • DBACKED_DAEMON_NAME="staging" ENV
    • "daemonName": staging CFG
Last Updated: 10/23/2018, 5:11:27 PM