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
freeorpro- Optionnal Default: free
--subscription-type freeCLIDBACKED_SUBSCRIPTION_TYPE=freeENV"subscriptionType": "free"CFG
- Agent ID: Used when multiple instances of DBacked are launched to identify which made the backup
- Optionnal
--agent-id awesome-agentCLIDBACKED_AGENT_ID=awesome-agentENV"agentId": "awesome-agent"CFG
- Database tools download directory: where to download tools like
pg_dumpandmongorestore- Optionnal Default: /tmp/dbacked
--database-tools-directory /tmp/dbackedCLIDBACKED_DATABASE_TOOLS_DIRECTORY=/tmp/dbackedENV"databaseToolsDirectory": "/tmp/dbacked"CFG
- DBacked Pro API key: Used to identify to DBacked servers when using pro version
- DBacked PRO
--apikey thisismyapikeyCLIDBACKED_APIKEY=thisismyapikeyENV"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.comCLIDBACKED_EMAIL=john@gmail.comENV"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 * * *"CLIDBACKED_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 XXXXXCLIDBACKED_PUBLIC_KEY=XXXXXENV"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 XXXXXCLIDBACKED_S3_ACCESS_KEY_ID=XXXXXENV"s3accessKeyId": "XXXXX"CFG
- S3 Secret Access Key:
- DBacked FREE Required
--s3-secret-access-key XXXXXCLIDBACKED_S3_SECRET_ACCESS_KEY=XXXXXENV"s3secretAccessKey": "XXXXX"CFG
- S3 Region: Should be a valid AWS S3 region
- DBacked FREE Required
--s3-region eu-west-1CLIDBACKED_S3_REGION=eu-west-1ENV"s3region": "eu-west-1"CFG
- S3 Bucket Name: This bucket needs to be created before
- DBacked FREE Required
--s3-bucket test-bucketCLIDBACKED_S3_BUCKET=test-bucketENV"s3bucket": "test-bucket"CFG
Database config
- Database type: can be
pg,mysqlormongodb- Required
--db-type pgCLIDBACKED_DB_TYPE=pgENV"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/prodCLIDBACKED_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 localhostCLIDBACKED_DB_HOST="localhost"ENV"dbHost": "localhost"CFG
- Database Port:
- PostgreSQL and MySQL Only Optionnal
--db-port 5432CLIDBACKED_DB_PORT="5432"ENV"dbPort": "5432"CFG
- Database Username:
- PostgreSQL and MySQL Only Optionnal
--db-username backupCLIDBACKED_DB_USERNAME="backup"ENV"dbUsername": "backup"CFG
- Database Password:
- PostgreSQL and MySQL Only Optionnal
--db-password secretpasswordCLIDBACKED_DB_PASSWORD="secretpassword"ENV"dbPassword": "secretpassword"CFG
- Database Name:
- PostgreSQL and MySQL Only Required
--db-name prodCLIDBACKED_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 stagingCLIDBACKED_DB_ALIAS="staging"ENV"dbAlias": "staging"CFG
Misc
- Dumper Options: Additionnal arguments to provide to
pg_dump,mysqldumpormongodump- Optionnal
--dumper-options "--no-privileges"CLIDBACKED_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-analyticsCLIDBACKED_SEND_ANALYTICS="true"ENV"sendAnalytics": trueCFG
- 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
--daemonCLIDBACKED_DAEMON="true"ENV"daemon": trueCFG
- 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 stagingCLIDBACKED_DAEMON_NAME="staging"ENV"daemonName": stagingCFG