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)
--no-verify bool false Skip URL connectivity verification

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.

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_*

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.