Documentation menu

Version 1.8.0-community

Database Connections

Configure the source, destination, and replica connections, and the privileges each account needs.

GoArchive connects to a source server, a destination server, and optionally a replica.

Source and destination

source:
  host: source-db.internal
  port: 3306
  user: archiver
  password: change_me
  database: production
  tls: preferred
  max_connections: 10
  max_idle_connections: 5

destination:
  host: archive-db.internal
  port: 3306
  user: archiver
  password: change_me
  database: archive
  tls: preferred
  max_connections: 10
  max_idle_connections: 5
SettingDescriptionDefault
hostServer hostnamerequired
portServer port3306
userAccount namerequired
passwordAccount password
databaseDatabase namerequired
tlsdisable, preferred, skip-verify, or requiredpreferred
max_connectionsMaximum open connections10
max_idle_connectionsMaximum idle connections5

Tracking tables

GoArchive keeps its progress records on the destination server. By default they live alongside the archived data, in destination.database.

To keep them separate, name a schema of their own:

destination:
  database: archive
  job_schema: goarchive

The schema must exist before the first run; GoArchive creates its tables inside it but does not create the schema itself.

Replica monitoring

Configure a replica to have GoArchive pause while replication falls behind:

replica:
  enabled: true
  host: replica-db.internal
  port: 3306
  user: repl_user
  password: change_me
  replication_channel: ""

Leave replication_channel empty to monitor the default channel, or name one to scope the check. Thresholds are set in Processing and Safety .

Privileges

ServerPrivilegesUsed for
SourceSELECTReading the rows to move
SourceDELETERemoving them β€” archive and purge only
SourceSELECT ON *.*Confirming that no table outside the job references data inside it
DestinationSELECT, INSERTWriting archived rows
Tracking schemaCREATE, SELECT, INSERT, UPDATEMaintaining progress records
ReplicaREPLICATION CLIENTReading replication status
-- source
GRANT SELECT, DELETE ON production.* TO 'archiver'@'%';
GRANT SELECT ON *.* TO 'archiver'@'%';

-- destination, tracking tables alongside the data
GRANT SELECT, INSERT, CREATE, UPDATE ON archive.* TO 'archiver'@'%';

-- replica, if configured
GRANT REPLICATION CLIENT ON *.* TO 'archiver'@'%';

The copy workflow never removes anything, so it does not need DELETE on the source.

validate confirms the account holds what the run requires and reports anything missing:

goarchive validate -c archiver.yaml

Credentials

The configuration file contains passwords. Restrict it accordingly:

chmod 600 archiver.yaml

GoArchive never writes credentials or connection strings to its logs.