Could easily be modified for others ...
The search criteria are currently hard-coded. Should change that...
Uses env.json
for URL, token, bucket, and org
You will need to create this file correctly to run.
{
"url": "http://localhost:9999",
"token": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"org": "example-oss-org",
"bucket": "old-bucket",
"dest_url": "https://cloud2.influxdata.com",
"dest_token": "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR",
"dest_org": "example-cloud2-org",
"dest_bucket": "new-bucket"
}
- Verify the cloud 2 configuration, create the bucket and aquire the read/write token
- Clone the repo:
git clone https://github.com/darinfisher/js-influxdb2-dumpbucket.git
- Initialize to build the dependencies:
cd js-influxdb2-dumpbucket && yarn
- Create your env file:
env.json
- Verify the
fluxQuery
is defined to get the data you want.
To grab everthing in the bucket use'from( bucket:"' + bucket + '" ) |> range( start: 0 )'
- Run:
node .