Synchronize local changes
Цей контент ще не доступний вашою мовою.
These steps are for developers who work on a workspace with the hmi CLI. They send the changes in
a pulled workspace to the cloud and bring cloud changes into it. How pull,
push, and conflicts work is in About local sync. Every command and
error code is in the CLI reference.
Review what push will send
Section titled “Review what push will send”- Run
pnpm hmi statusto list local changes, conflicts, and the local and server revisions. - Run
pnpm hmi checkand fix every error it prints. - To see the exact plan, run
pnpm hmi push --dry-run. It prints the setup operations, changed paths, and file counts as JSON and sends nothing, also while conflicts are unresolved.
Push your changes
Section titled “Push your changes”-
Run
pnpm hmi push. It builds the dashboards, runshmi check, uploads the file contents the server lacks, and sends the changes.Nothing to push.means there was nothing to send. -
If push fails or refuses, find the message in this table and follow its row, then push again:
Message Action push_conflict, orRefusing push: N unresolved conflictFollow Resolve sync conflicts push failed: hmi check failedFix the errors printed after it Changed files under src/dashboards/<id>refusedRun pnpm hmi pullfirst. If the dashboard was deleted in the cloud, delete its folderpush_admin_requiredPut the workspace name and branding files back as they are on the server, or ask an admin or owner to push them push_validation_failed, other codesRead detailsin the JSON after the code and fix that item; codes are in Push errorsNo answer, or unfinished pushinhmi statusFollow Retry an interrupted push push_id_reusedFollow Retry an interrupted push
Retry an interrupted push
Section titled “Retry an interrupted push”If push gets no answer, for example because the network dropped, the server may or may not have
applied it. hmi status then shows unfinished push: <id>.
- Run
pnpm hmi pushagain. It sends the push under the same ID, and the server returns the result of the first attempt instead of applying the changes twice. The server remembers push IDs for 30 days. - If push fails with
push_id_reused, the ID cannot be used for this push: an earlier attempt was applied but its answer was lost and your local changes have changed since, or someone else’s push uses the ID, for example from a copiedsetup.db. The CLI drops the ID. Runpnpm hmi pull, thenpnpm hmi pushagain.
Get changes from the cloud
Section titled “Get changes from the cloud”- Run
pnpm hmi pull. Your local changes stay. Server changes to everything you did not change are applied. - If pull reports conflicts, follow Resolve sync conflicts.
- If the CLI refuses
setup.dbas newer than itself, update@overvis/hmi-cli. - If the CLI says
setup.dbis too old to upgrade, runpnpm hmi export --local > <file>to keep a raw dump, thenpnpm hmi pull --rebuild. Add--discard-localif it refuses because of local changes.
Run pnpm hmi pull before you push when you know the workspace changed in the cloud, for example
after logo or favicon edits in workspace settings.
Back up and restore local changes
Section titled “Back up and restore local changes”Pull, resolve, and push handle concurrent edits. To start from a clean cloud copy and re-apply your work as a reviewed merge instead:
-
Make a local-only archive. It needs no clean checkout and contacts no server:
Terminal window pnpm hmi download --no-readings --no-const-values ../mine.sqliteThe archive holds the complete local setup and synced files, including new and edited files. It may contain endpoint PIN codes: store it as a secret.
-
Replace the local copy with the cloud copy:
Terminal window pnpm hmi pull --discard-local -
Merge the archive back and push it:
Terminal window pnpm hmi upload ../mine.sqliteuploadcompares the archive with the freshly pulled checkout, asks before each conflict, applies the selected changes, and pushes them. Use--forceonly after reviewing the archive and the destination.
To keep only a JSON copy of local edits, pnpm hmi export > <file> writes the unpushed changes and
pnpm hmi import <file> applies them again; see
export / import.