Exit strategy
There are two primary ways of systematically exporting the data from OS2iot:
Using the REST API
Ideal if you want to import/change it into something else, and OS2iot is still running.
Exporting the database
If OS2iot is no longer running, the postgres database will contain all the data from the system.
Export using the REST API
The REST API documentation is available at https://your-backend-hostname.tld/api/v1/docs/#/
After using the login endpoint to get a JWT, use it for the calls.
It is recommended that you use a user with Global Admin privileges to export data.
Depending on the goal of the exit, you want to use different data, but in general the following order to export data is recommended:
Organization
Applications
Device Model
IoTDevices
Datatargets
Payload decoder
IoT-Device, PayloadDecoder and DataTarget Connection
Optionally you can export the internal users and their access groups:
User
Permission
If you want to export Sigfox data too then:
Sigfox Group
Sigfox Device Type
Sigfox Contract
If you want to export LoRaWAN (Chirpstack) data then:
Gateway
Service Profile
Device Profile
Export using the database
A full database dump of the PostgreSQL database will backup most of the data. Sigfox data is stored in their backend; LoRaWAN gateways, service-profiles, and device-profiles are stored in Chirpstacks PostgreSQL database.
It is recommended to use pg_dump
to dump the database: https://www.postgresql.org/docs/current/backup-dump.html
I.e. pg_dump -d os2iot -U os2iot -W -h localhost -p 5433 > backup.sql
will perform the export on the docker-compose setup described in the Installation Guide.