Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To duplicate the measurement points and data from one root device to another in Apache IoTDB, you can follow these steps:

  1. Open the source IoTDB instance and navigate to the database you want to copy.

  2. Use the "SHOW TIMESERIES" command to obtain a list of all metrics present in the database.

  3. Use the "EXPORT" command to generate a file containing all the data you want to copy. For example, if you want to copy all data from the "metrics" database, you can use the following command:

    EXPORT "metrics.csv" WITH csv

  4. Move the exported file to the destination IoTDB instance.

  5. Open the destination IoTDB instance and navigate to the database where you want to import the data.

  6. Use the "CREATE TIMESERIES" command to create all the metrics present in the exported file. For example, if you exported data from the "metrics" database, you can use the following command to create a timeseries with the same properties in the destination database:

    CREATE TIMESERIES root.metrics WITH DATATYPE=DOUBLE, ENCODING=PLAIN

  7. Use the "IMPORT" command to import the data from the exported file. For example, you can use the following command to import data from the "metrics.csv" file:

    IMPORT "metrics.csv" WITH csv

  8. Once the data is imported, you can use the "SHOW TIMESERIES" command to verify that all metrics and data have been successfully copied to the destination IoTDB instance.