You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/en/docs-dev/user-guide/command-line-tool.md
+47-3Lines changed: 47 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,6 +153,7 @@ Available Commands:
153
153
piped Manage piped resources.
154
154
plan-preview Show plan preview against the specified commit.
155
155
plugin Do plugin tasks.
156
+
transfer Transfer data between control planes.
156
157
version Print the information of current binary.
157
158
158
159
Flags:
@@ -357,11 +358,11 @@ You can encrypt it the same way you do [from the web](../managing-application/se
357
358
--input-file={PATH_TO_SECRET_FILE}
358
359
```
359
360
360
-
Note: The docs for pipectl available command is maybe outdated, we suggest users use the `help` command for the updated usage while using pipectl.
361
+
> **Note:** The docs for pipectl available command may be outdated. We suggest users use the `help` command for the updated usage while using pipectl.
361
362
362
363
### Migrating application configs and database
363
364
364
-
Migrate v0 application configs and database records to be compatible with the plugin-based pipedv1.
365
+
Migrate v0 application configs and database records to be compatible with the plugin-based piped v1.
365
366
366
367
#### Migrating application config
367
368
@@ -383,7 +384,7 @@ The `--config-files` and `--dirs` flags are mutually exclusive; one of them is r
383
384
384
385
#### Migrating database
385
386
386
-
Migrate database records to be compatible with plugin-architectured piped:
387
+
Migrate database records to be compatible with plugin-architected piped:
387
388
388
389
```console
389
390
pipectl migrate database \
@@ -408,6 +409,49 @@ pipectl plugin push \
408
409
409
410
The `--files` flag maps platforms to binary files in `os/arch=filepath` format. All of `--files`, `--tag`, `--registry`, and `--repository` are required. Add `--insecure` to skip TLS verification when using an HTTP-only registry.
410
411
412
+
### Transferring data between control planes
413
+
414
+
Transfer pipeds and applications from one control plane to another.
415
+
416
+
#### Backing up data
417
+
418
+
Back up all pipeds and applications from the source control plane to a local file:
419
+
420
+
```console
421
+
pipectl transfer backup \
422
+
--address={SOURCE_CONTROL_PLANE_API_ADDRESS} \
423
+
--api-key={SOURCE_API_KEY} \
424
+
--output-file=backup.json
425
+
```
426
+
427
+
Add `--labels` to filter applications by labels (comma-separated `KEY:VALUE` pairs, e.g. `--labels=env:prod,team:backend`). Deployment history is not included, because the API does not expose a write endpoint for deployments.
428
+
429
+
#### Restoring data
430
+
431
+
Restoring is a two-step process, because the control plane validates that each application's Git repository is registered on the target piped before the application can be created, and repository registration only happens after the piped agent connects.
432
+
433
+
1. Register the pipeds on the target control plane, then update each piped's configuration with the new ID and key before restarting the piped agents:
434
+
435
+
```console
436
+
pipectl transfer restore piped \
437
+
--address={TARGET_CONTROL_PLANE_API_ADDRESS} \
438
+
--api-key={TARGET_API_KEY} \
439
+
--input-file=backup.json \
440
+
--output-file=mapping.json
441
+
```
442
+
443
+
2. Once the piped agents have reconnected to the target control plane and registered their repositories, restore the applications:
444
+
445
+
``` console
446
+
pipectl transfer restore application \
447
+
--address={TARGET_CONTROL_PLANE_API_ADDRESS} \
448
+
--api-key={TARGET_API_KEY} \
449
+
--input-file=backup.json \
450
+
--piped-id-mapping-file=mapping.json
451
+
```
452
+
453
+
Disabled applications from the source are restored and immediately re-disabled on the target to preserve their original status.
454
+
411
455
### You want more?
412
456
413
457
We always want to add more needed commands into pipectl. Please let us know what command you want to add by creating issues in the [pipe-cd/pipecd](https://github.com/pipe-cd/pipecd/issues) repository. We also welcome your pull request to add the command.
description: Generated by `pipectl init`. See https://pipecd.dev/docs/user-guide/configuration-reference/ for more.
410
+
The `--files` flag maps platforms to binary files in `os/arch=filepath` format. All of `--files`, `--tag`, `--registry`, and `--repository` are required. Add `--insecure` to skip TLS verification when using an HTTP-only registry.
411
+
412
+
### Transferring data between control planes
413
+
414
+
Transfer pipeds and applications from one control plane to another.
415
+
416
+
#### Backing up data
417
+
418
+
Back up all pipeds and applications from the source control plane to a local file:
419
+
420
+
```console
421
+
pipectl transfer backup \
422
+
--address={SOURCE_CONTROL_PLANE_API_ADDRESS} \
423
+
--api-key={SOURCE_API_KEY} \
424
+
--output-file=backup.json
388
425
```
389
426
390
-
See [Feature Status](../feature-status/_index.md#pipectl-init).
427
+
Add `--labels` to filter applications by labels (comma-separated `KEY:VALUE` pairs, e.g. `--labels=env:prod,team:backend`). Deployment history is not included, because the API does not expose a write endpoint for deployments.
428
+
429
+
#### Restoring data
430
+
431
+
Restoring is a two-step process, because the control plane validates that each application's Git repository is registered on the target piped before the application can be created, and repository registration only happens after the piped agent connects.
432
+
433
+
1. Register the pipeds on the target control plane, then update each piped's configuration with the new ID and key before restarting the piped agents:
434
+
435
+
```console
436
+
pipectl transfer restore piped \
437
+
--address={TARGET_CONTROL_PLANE_API_ADDRESS} \
438
+
--api-key={TARGET_API_KEY} \
439
+
--input-file=backup.json \
440
+
--output-file=mapping.json
441
+
```
442
+
443
+
2. Once the piped agents have reconnected to the target control plane and registered their repositories, restore the applications:
444
+
445
+
``` console
446
+
pipectl transfer restore application \
447
+
--address={TARGET_CONTROL_PLANE_API_ADDRESS} \
448
+
--api-key={TARGET_API_KEY} \
449
+
--input-file=backup.json \
450
+
--piped-id-mapping-file=mapping.json
451
+
```
452
+
453
+
Disabled applications from the source are restored and immediately re-disabled on the target to preserve their original status.
0 commit comments