Skip to content

Commit

Permalink
Astarte Export: Update README.md
Browse files Browse the repository at this point in the history
Update README.md with environment variables and export commands

Signed-off-by: Osman Hadzic <[email protected]>
  • Loading branch information
osmanhadzic committed Jan 16, 2025
1 parent 5a49f2c commit c711396
Showing 1 changed file with 49 additions and 4 deletions.
53 changes: 49 additions & 4 deletions tools/astarte_export/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# astarte_export

## ⚠ Warning

This tool is still in alpha phase, don't rely on it for critical migrations.

Astarte Export is an easy to use tool that allows to exporting all the devices and data from an existing Astarte realm to XML format.

```iex
Expand All @@ -15,6 +11,55 @@ level=info ts=2020-02-03T03:57:21.437+00:00 msg="Export Completed." module=Astar
{:ok, :export_completed}
iex([email protected])7>
```

## Environment variables

``` bash
export export CASSANDRA_DB_HOST="127.0.0.1"
export CASSANDRA_DB_PORT=9042
export CASSANDRA_NODES="localhost:9042"
```
## Exporting Data with Astarte

You can export data from an Astarte realm using the following commands.

Export Data for All Devices in a Realm
To export data for all devices in a realm:

```bash
mix astarte.export <REALM> <FILE_XML>
```
- `<REALM>`: The name of the Astarte realm.
- `<FILE_XML>`: The output file path where the exported data will be saved.

Export Data for All Devices in a Realm
To export data for all devices in a realm:

## Export Data for a Specific Device

To export data for a single device in a realm:

```bash
mix astarte.export <REALM> <FILE_XML> <DEVICE_ID>
```

- `<REALM>`: The name of the Astarte realm.
- `<FILE_XML>`: The output file path where the exported data will be saved.
- `<DEVICE_ID>`: The unique identifier of the device (e.g., "ogmcilZpRDeDWwuNfJr0yA").

## Example Commands

Export all devices in the realm example_realm:

``` bash
mix astarte.export example_realm devices_data.xml
```
Export data for a specific device yKA3CMd07kWaDyj6aMP4Dg in the realm example_realm:

``` bash
mix astarte.export example_realm device_data.xml yKA3CMd07kWaDyj6aMP4Dg
```

The exported realm data is captured in xml_format as below.

```xml
Expand Down

0 comments on commit c711396

Please sign in to comment.