- 12 Nov 2024
-
DarkLight
-
PDF
db migrate local-to-etcd
- Updated on 12 Nov 2024
-
DarkLight
-
PDF
iagctl db migrate local-to-etcd
Allows a user to migrate data from a local database to an etcd
database
Synopsis
This command will move data from the local database configured at GATEWAY_APPLICATION_WORKING_DIR/gateway.db
to the etcd
database located at GATEWAY_STORE_ETCD_HOSTS
.
Ensure that all GATEWAY_STORE_ETCD_*
configuration variables are properly set to ensure that this command will function. Moreover, all database keys will include the cluster ID set by GATEWAY_APPLICATION_CLUSTER_ID
. For example, a database record for a python script will have a key that resembles the following: gateway/cluster_1/services/v1/python-script/my-script
.
iagctl db migrate local-to-etcd [flags]
Examples
Migrate Non-Conflicting Records
Moves non conflicting records from the local database to an etcd
database. If a record with the same key already exists on the etcd
database it will be skipped to avoid overwriting any existing data.
>_ iagctl db migrate local-to-etcd
Migrate All Records
Moves all records from a local database to an etcd
database. If a record with the same key already exists on the etcd
database it will be overwritten due to the --force
flag.
>_ iagctl db migrate local-to-etcd --force
View Possible Changes
If the --check
flag is used, no data will be moved. Gateway will only display a table with information about the data to be migrated or skipped/replaced depending on the use of the --force
flag.
>_ iagctl db migrate local-to-etcd --check
>_ iagctl db migrate local-to-etcd --check --force
Options
--check Displays a report of what data would be migrated but causes no data to actually be moved.
--force If a conflicting record already exists on the etcd database, replace it.
-h, --help Help for local-to-etcd
Options Inherited from Parent Commands
--config string Path to the configuration file
--raw Displays the result of the command in its raw format
--verbose Enable verbose output
CLI References
See related db
commands:
For all CLI commands see → Command References Index