github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/docs/user_docs/cli/kbcli_migration_create.md (about) 1 --- 2 title: kbcli migration create 3 --- 4 5 Create a migration task. 6 7 ``` 8 kbcli migration create NAME [flags] 9 ``` 10 11 ### Examples 12 13 ``` 14 # Create a migration task to migrate the entire database under mysql: mydb1 and mytable1 under database: mydb2 to the target mysql 15 kbcli migration create mytask --template apecloud-mysql2mysql 16 --source user:123456@127.0.0.1:3306 17 --sink user:123456@127.0.0.1:3305 18 --migration-object '"mydb1","mydb2.mytable1"' 19 20 # Create a migration task to migrate the schema: myschema under database: mydb1 under PostgreSQL to the target PostgreSQL 21 kbcli migration create mytask --template apecloud-pg2pg 22 --source user:123456@127.0.0.1:3306/mydb1 23 --sink user:123456@127.0.0.1:3305/mydb1 24 --migration-object '"myschema"' 25 26 # Use prechecks, data initialization, CDC, but do not perform structure initialization 27 kbcli migration create mytask --template apecloud-pg2pg 28 --source user:123456@127.0.0.1:3306/mydb1 29 --sink user:123456@127.0.0.1:3305/mydb1 30 --migration-object '"myschema"' 31 --steps precheck=true,init-struct=false,init-data=true,cdc=true 32 33 # Create a migration task with two tolerations 34 kbcli migration create mytask --template apecloud-pg2pg 35 --source user:123456@127.0.0.1:3306/mydb1 36 --sink user:123456@127.0.0.1:3305/mydb1 37 --migration-object '"myschema"' 38 --tolerations '"step=global,key=engineType,value=pg,operator=Equal,effect=NoSchedule","step=init-data,key=diskType,value=ssd,operator=Equal,effect=NoSchedule"' 39 40 # Limit resource usage when performing data initialization 41 kbcli migration create mytask --template apecloud-pg2pg 42 --source user:123456@127.0.0.1:3306/mydb1 43 --sink user:123456@127.0.0.1:3305/mydb1 44 --migration-object '"myschema"' 45 --resources '"step=init-data,cpu=1000m,memory=1Gi"' 46 ``` 47 48 ### Options 49 50 ``` 51 -h, --help help for create 52 --migration-object strings Set the data objects that need to be migrated,such as '"db1.table1","db2"' 53 --resources strings Resources limit for migration, such as '"cpu=3000m,memory=3Gi"' 54 --sink string Set the sink database information for migration.such as '{username}:{password}@{connection_address}:{connection_port}/[{database}] 55 --source string Set the source database information for migration.such as '{username}:{password}@{connection_address}:{connection_port}/[{database}]' 56 --steps strings Set up migration steps,such as: precheck=true,init-struct=true,init-data=true,cdc=true 57 --template string Specify migration template, run "kbcli migration templates" to show all available migration templates 58 --tolerations strings Tolerations for migration, such as '"key=engineType,value=pg,operator=Equal,effect=NoSchedule"' 59 ``` 60 61 ### Options inherited from parent commands 62 63 ``` 64 --as string Username to impersonate for the operation. User could be a regular user or a service account in a namespace. 65 --as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups. 66 --as-uid string UID to impersonate for the operation. 67 --cache-dir string Default cache directory (default "$HOME/.kube/cache") 68 --certificate-authority string Path to a cert file for the certificate authority 69 --client-certificate string Path to a client certificate file for TLS 70 --client-key string Path to a client key file for TLS 71 --cluster string The name of the kubeconfig cluster to use 72 --context string The name of the kubeconfig context to use 73 --disable-compression If true, opt-out of response compression for all requests to the server 74 --insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure 75 --kubeconfig string Path to the kubeconfig file to use for CLI requests. 76 --match-server-version Require server version to match client version 77 -n, --namespace string If present, the namespace scope for this CLI request 78 --request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0") 79 -s, --server string The address and port of the Kubernetes API server 80 --tls-server-name string Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used 81 --token string Bearer token for authentication to the API server 82 --user string The name of the kubeconfig user to use 83 ``` 84 85 ### SEE ALSO 86 87 * [kbcli migration](kbcli_migration.md) - Data migration between two data sources. 88 89 #### Go Back to [CLI Overview](cli.md) Homepage. 90