Drift and export
Weik.io 2026.2Find changes made by hand with a nightly weikio diff, and write what runs as YAML files with weikio export. Video
Watch: Deleting and undoing through Git, 3:59
The video deletes a deployment by removing its document from the repository and undoes the delete with git revert.
This part of the video couldn't be loaded.
On this page
A nightly weikio diff shows which documents of your folder someone changed by hand with the CLI or the admin UI. The next apply puts the document back, but leaves alone anything added by hand that the folder never had. To write what runs as YAML files, use weikio export.
A nightly drift check#
To see what somebody changed by hand, run weikio diff against production every night in a workflow such as this one:
name: drift
on:
schedule:
- cron: '0 3 * * *'
env:
WEIKIO_SERVER: https://weikio.example.com
jobs:
drift:
runs-on: ubuntu-latest
environment: production-plan
env:
WEIKIO_API_KEY: ${{ secrets.WEIKIO_API_KEY }}
steps:
- uses: actions/checkout@v4
- run: |
curl -fsSL https://weik.io/install.sh | WEIKIO_CLI_VERSION=2026.2.4 sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: weikio diff -f ./finance/production --env production --prune financeThe job fails when the diff finds a difference, because weikio diff exits with 2 when Weik.io differs from the folder. A pipeline can branch on the exit codes, which are fixed.
| Exit code | Meaning |
|---|---|
| 0 | No change |
| 2 | Changes or drift found, which the output lists |
| 7 | A document or a directory can’t be applied |
| 1 | An error, such as an installation that can’t be reached |
Changes made in the admin UI#
When an apply replaces files or fields that a person saved in the admin UI, a warning row shows whose save it replaced and when.
Prune keeps an integration made in the browser, because no apply of the folder put it there. It also keeps one that the folder put there and a person later switched to editing in the browser. The apply lists that one as kept. To remove either of them, delete it by hand.
Export everything#
weikio export writes documents as multi-document YAML that applies again unchanged:
$ weikio export --project finance --out-dir ./outWithout --out-dir, the YAML goes to standard output.
| Flag | What it does |
|---|---|
-- |
Writes one file per kind, named for the kind in the plural, such as integrations.yaml or api-, and prints a line for each file it wrote |
--env production |
Exports the documents of one environment |
When a platform administrator exports with no project, the export starts with the installation’s settings.
An export never contains a secret’s value. Set the values again with weikio secret set where you apply the export.
Start a Git repository#
If you set up your projects in the admin UI, an export moves them into Git:
- Export each project’s documents into the repository’s folders.
- Put each Camel integration’s folder of files beside them.
- Apply them from the pipeline with
--prune, which deletes nothing on the first apply.
Move between installations#
An export also moves a project to another installation, for example from a self-hosted installation to Weik.io Cloud or back:
$ weikio export --project finance --out-dir ./finance-export
$ weikio apply -f ./finance-export --context new-hubThen finish the move in the new installation:
- Apply each Camel integration’s directory from your repository to build its versions.
- Set the secrets.
- Enrol the agents.
- Deploy the integrations.
Users and API keys aren’t kept in Git, so create them in the new installation too.