Import and export up.yaml
The control node stores your project configuration. The database is the source
of truth, and the console and the CLI both write it. An up.yaml file is
optional: use it to seed a project and to keep a copy, not to drive every
change.
This guide shows how to import a file into a project and how to export a project back to a file.
Before you start
You need:
- a control node that the CLI can reach (see the CLI client);
- a project in the control node, or permission to create one.
Import a file
Run:
up apply -f up.yaml
The command reads the file, creates missing resources, and updates resources
that differ. It never deletes by default, so a file that omits a resource does
not remove it. To delete resources that are absent from the file, add --prune:
up apply -f up.yaml --prune
Import is idempotent. Run it as often as you like. To preview the changes
first, run up diff -f up.yaml.
Export a project
Run:
up export my-project --out up.yaml
The command reads the project from the control node and writes it as
up.yaml. Omit --out to print to standard output. The top-level services
list is the default environment’s services.
Use an export to keep a copy in version control, to move a project to another control node, or to see the stored configuration as a file.
How the two sides relate
- The control node stores the project. The console and the CLI edit it directly.
up applypushes a file into the project. It creates and updates.up exporttakes a snapshot of the project.- A GitHub push deploys the services of the pushed repository. It reads the stored configuration, so it never needs a file.
An export is a snapshot, not a synchronization. After you change a project in the console, export again to refresh the file.
Limits
- Import does not delete unless you pass
--prune. - Import sets the resources the file declares. It does not remove an environment or a registry that the file omits.
- The environment catalog lives on the project. Import creates and updates environments, but removing one stays an explicit action.
- Export omits credentials: it never writes a git token or a registry password. Import keeps the stored credential when the file omits it, so an exported file can be re-imported without a credential being cleared.