For AI agents: the complete documentation index is at llms.txt. Every page is also available as markdown by appending .md to its URL, or by sending an Accept: text/markdown request header.

Copy data between QuestDB instances

Copy a subset of data from one QuestDB instance to another for testing or development purposes.

Problem​

You want to copy data between QuestDB instances. This method allows you to copy any arbitrary query result, but if you want a full database copy please check the backup and restore documentation. To copy only the structure, see Copy a schema to another instance.

Solution: Table2Ilp utility​

QuestDB ships with a utils folder that includes a tool to read from one instance (using the PostgreSQL protocol) and write into another (using ILP).

You would need to compile the jar, and then use it like this:

java -cp utils.jar io.questdb.cliutil.Table2Ilp \
-d trades \
-dilp "https::addr=localhost:9000;username=admin;password=quest;" \
-s "trades WHERE start_time in '2022-06'" \
-sc "jdbc:postgresql://localhost:8812/qdb?user=account&password=secret&ssl=false" \
-sym "ticker,exchange" \
-sts start_time

This reads from the source instance using PostgreSQL wire protocol and writes to the destination using ILP.

Alternative: Export endpoint​

You can also use the export endpoint to export data to CSV or other formats.