3

I am trying to move data from InfluxDB to QuestDB,

I was able to export my tables as JSON by following: https://stackoverflow.com/a/27913640/1267728

How do I now import these JSON files into QuestDB?

Awalias
  • 2,027
  • 6
  • 31
  • 51

3 Answers3

2

Convert from JSON to CSV

QuestDB supports importing data via CSV file, so first you would need to flatten the JSON and ensure that column names are modified to reflect nested properties.

There is a Java library called Json2Flat that already does this.

Import the CSV file

Using the REST API, you can import the data into QuestDB

curl -F data=file.csv http://localhost:9000/imp

For more details of how to use the REST API, please go to the official documentation.

Check the data

To verify that the import is successful, you can check via the Web Console or via CURL…

curl -G --data-urlencode "query=select * from 'file.csv'" http://localhost:9000/exp
J14342
  • 21
  • 1
0

Just adding here that QuestDB recently improved the performance of CSV ingestion. More info at https://questdb.io/docs/guides/importing-data/

Javier Ramirez
  • 3,446
  • 24
  • 31
0

If you want to avoid converting from JSON (and probably more performant as well than exporting to JSON for large tables), you can use the influxd inspect export-lp command that exports all your data as ILP points. You can choose to export a single bucket.

Once you have the ILP files, you can import as explained at this other StackOverflow post What's the best way to upload an ILP file into QuestDB?

Javier Ramirez
  • 3,446
  • 24
  • 31