Skip to main content

kapi context restore

kapi restore <bundle>

Read a file written by "kapi context export" into this project's store, with every identity it left with.

A store that already holds context is left alone until you say what should happen to it. --merge reads the file over what is there, which is idempotent: restoring the same file twice leaves the same store. --replace puts the file in place of what is there, so what is left is the file and nothing else.

With --workspace it reads a whole-machine backup: every project in the file comes back under the name and identity it had, whether or not you have a checkout of it here. The same two flags apply, and --replace names every project whose context it is about to empty before it empties any of them.

Commandcontext restore
Try it

Runs in your browser against a small sample file. Edit the command before running, or press Run to execute it as shown.

kapi context restore context.kpz
Flags
FlagTypeDefaultDescription
--mergeboolfalseread the file over the context the store already holds
--project, -pstringpath to a kapi.yaml project recipe or its directory (auto-discovered from cwd if omitted)
--replaceboolfalseput the file in place of the context the store already holds
--workspaceboolfalseread a whole-machine backup, every project in it
More examples
kapi context restore context.kpz --merge
kapi context restore context.kpz --replace
kapi context restore --workspace backups/everything.kpz

← Back to the Command Reference