Skip to content

restore ​

Recover a form YAML from a run artifact's frozen config.yaml snapshot. Every run copies the source YAML into the artifact dir — restore brings it back to the library.

basic usage ​

bash
gform restore                      # TTY: pick an artifact
gform restore a3f9c1e2b4d60718
gform rs a3f9c1e2                  # prefix match works
gform restore a3f9c1e2/r01          # child run inside a batch

Writes to $GFORM_HOME/forms/<name>.yaml using the name: from the snapshot. Refreshes the stamped comment header; keeps the snapshotted options / steps / unique / pools intact (not an init scaffold).

Find ids with gform run list or gform run last. See artifacts.md.

save under a new name ​

bash
gform restore <id> --save-as <name>
gform restore <id> -a backup

Rewrites the name: field and uses the new basename. Cannot use reserved names: list, ls, view, v, last.

custom output path ​

bash
gform restore <id> --out ./recovered.yaml

Writes to an explicit path instead of the library.

force overwrite ​

bash
gform restore <id> --force
gform restore <id> --save-as <name> --force

Without --force, restore refuses if the destination file already exists.

when to restore ​

situationaction
accidentally edited/deleted library YAMLrestore <id> from last good run
compare what actually ran vs current filerestore to --save-as temp name
batch child used different pool resolutionrestore parent batch id's config
artifact predates config snapshotsnot restorable — no config.yaml

Restore prints the artifact id and original sourcePath when available.

gotchas ​

  • Only artifacts with config.yaml work — very old runs may lack it.
  • Restore validates via the same schema as gform verify.
  • Restoring does not delete the artifact — it's a copy out.
  • Batch parent id restores the batch-level config (the YAML used for the whole batch).