Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
InfluxDB SELECT INTO backing up and restoring data method.
SELECT -- explicit value selecting and casting
time,
Humidity::integer,
Temperature::integer,
State
INTO "dbTo"."autogen"."sensor" -- explicit target db
FROM "dbFrom"."autogen"."sensor" -- explicit source db
WHERE time > '2018-03-25' AND time <= '2018-03-26' -- explicit time range
GROUP BY * -- copies all tags
SELECT * -- copies all values
INTO "dbTo"."autogen".:MEASUREMENT -- magically keeps the data structure intact
FROM "dbFrom"."autogen"./.*/ -- copies all measurements
GROUP BY * -- copies all tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.