> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.itential.com/itential-gateway/5/iagctl/db-migrate-etcd-to-local/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server. # iagctl db migrate etcd-to-local Migrate data from an etcd database to a local database. The `iagctl db migrate etcd-to-local` command moves data from the etcd database at `GATEWAY_STORE_ETCD_HOSTS` to the local database at `GATEWAY_APPLICATION_WORKING_DIR/gateway.db`. Before you run this command, verify that all `GATEWAY_STORE_ETCD_*` configuration variables are set correctly. The gateway prefixes all database keys with the cluster ID set by `GATEWAY_APPLICATION_CLUSTER_ID`. For example, a Python script record has a key that resembles `gateway/cluster_1/services/v1/python-script/my-script`. For more information, see [Store configuration variables](/itential-gateway/5/gateway-store-variables.mdx). ## Syntax ```bash iagctl db migrate etcd-to-local [flags] ``` ## Examples ### Migrate non-conflicting records The following example moves records from etcd to the local database. If a record with the same key already exists in the local database, the gateway skips it to avoid overwriting existing data: ```bash iagctl db migrate etcd-to-local ``` ### Migrate all records The following example moves all records and overwrites any existing records in the local database that have conflicting keys: ```bash iagctl db migrate etcd-to-local --force ``` ### Preview the migration Use the `--check` flag to display a report of what the gateway would migrate without moving any data. The report shows which records the gateway would skip or replace depending on whether you include `--force`: ```bash iagctl db migrate etcd-to-local --check ``` ```bash iagctl db migrate etcd-to-local --check --force ``` ## Options ```bash --check Display a report of what data would migrate without making changes. --force Replace conflicting records that already exist in the local database. -h, --help Help for etcd-to-local ``` ## Options inherited from parent commands ```bash --profile string Specify the client profile to use (case-insensitive, defaults to [client] section) --config string Path to the configuration file --raw Display the result of the command in raw format --verbose Enable verbose output ```