Skip to content

targets update

Update an existing target’s configuration fields.

clonit targets update <name> [flags]
Argument Description Required
name Name of the target to update Yes
Flag Type Default Description
--name string New target name
--db-type string Database type (postgres, postgresql)
--src-url string Source database URL
--dst-url string Destination database URL (empty string to clear)
--sanitize-dst-url string Sanitize destination database URL (empty string to clear)
--sanitize-query-file string Path to sanitization SQL file (empty string to clear)
--storage-profile string Storage profile name (empty string to clear)
--dump-jobs int 0 Number of parallel dump jobs
--restore-jobs int 0 Number of parallel restore jobs
--src-schema-include string[] Schemas to include in dump (glob patterns)
--src-schema-exclude string[] Schemas to exclude from dump (glob patterns)
--dst-schema-include string[] Schemas to include in restore (glob patterns)
--dst-schema-exclude string[] Schemas to exclude from restore (glob patterns)
--db-auth-mode string Database auth mode: password or rds_iam (keyless AWS RDS IAM token auth)
--db-region string AWS region used to sign RDS IAM tokens (empty string to clear)
--aws-profile string Named AWS profile (~/.aws) used to sign RDS IAM tokens for this target; overrides the agent-wide aws.profile config (empty string to clear)
--no-verify bool false Skip URL connectivity verification
--read-only bool false Mark the target read-only (blocks load/sanitize into it)

Updates only the fields that are explicitly provided via flags. This is a partial update – fields that are not specified retain their current values.

Setting --dst-url, --sanitize-dst-url, --sanitize-query-file, or --storage-profile to an empty string ("") will clear that field.

The command returns an error if no flags are provided.

By default, any new or changed database URLs are verified for connectivity. Use --no-verify to skip this check.

For a cloud-synced target, read_only is server-authoritative: changing it in the cloud (via clonit cloud sync) requires an org admin or the target’s owner. A sync from any other principal — including an enrolled agent’s org-level API key — keeps the cloud value and prints an advisory warning, and the agent applies the cloud value on every resolve. The cloud also refuses to dispatch remote snapshot.load commands at a read-only target.

Update the number of dump jobs:

clonit targets update mydb --dump-jobs 8

Change the destination URL:

clonit targets update mydb --dst-url "postgresql://user:pass@localhost:5432/mydb_restore"

Clear an optional field:

clonit targets update mydb --sanitize-query-file ""

Rename a target:

clonit targets update mydb --name mydb-production

Update with verification skipped:

clonit targets update mydb --src-url "postgresql://user:pass@new-host:5432/mydb" --no-verify

Add schema filtering to an existing target:

clonit targets update mydb --src-schema-include public,app_*

Migrate an existing target to keyless AWS RDS IAM auth (drops the stored password — see Keyless credentials):

clonit targets update mydb --db-auth-mode rds_iam

Clear schema filters:

clonit targets update mydb --src-schema-include ""

Schema filter flags accept comma-separated glob patterns. See targets add for details on schema filtering behavior.