-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat/docs: document import / export, rename .load / .dump to .import …
…/ .export
- Loading branch information
Showing
2 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: Import & Export | ||
description: "How to export and import data between cross.stream stores" | ||
sidebar: | ||
order: 5 | ||
--- | ||
|
||
The supervisor exposes two endpoints to facilitate data transfer between stores: | ||
|
||
- POST `/import`: Takes JSON frame data and imports it as-is, preserving frame `id` and content `hash` | ||
- POST `/cas`: Stores posted content in CAS and returns its hash | ||
|
||
## Commands | ||
|
||
`xs.nu` provides two commands to utilize these endpoints: | ||
|
||
```nushell | ||
# Export store at $env.XS_ADDR to path | ||
.export <path> | ||
# Import dump at path to $env.XS_ADDR | ||
.import <path> | ||
``` | ||
|
||
The exported data includes: | ||
- Frame metadata in `frames.jsonl` | ||
- Content files in `cas/` directory | ||
|
||
## Version Compatibility | ||
|
||
Version 0.1.0 was the first version supporting imports, though the 0.1.0 client can export data from 0.0.9 stores. | ||
|
||
## Example | ||
|
||
```sh | ||
# Export from remote store | ||
with-env {XS_ADDR: "https://user:[email protected]"} { | ||
.export backup | ||
} | ||
|
||
# Import to local store | ||
with-env {XS_ADDR: "./store"} { | ||
.import backup | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters