Copy InfluxDB data from remote database to local machine

I want to copy an InfluxDB database (really I just want a few specific measurements) that exists on a server onto my local machine in order to write some Kapacitor alerts. I’m trying to follow the documentation, but I’m not getting the desired result.

First, I tried influxd backup then an influx -restore. Using this method, I see the series exist but no data at all. “SHOW SERIES” and “SHOW MEASUREMENTS” look exactly as they should, but if i “SELECT * FROM <any_measurement>” there is no result. There are 300ish measurements and all of the 25 or so that I checked have the same result.

Next I attempted to use the influx_inspect export + influx -import. This just took forever. I only have a 24 hour retention period, 1.2G total disk usage, but somehow it went through over 300mil lines and would’ve been more but I killed it after waiting for 3 hours. I query for my data to see if any of it succeeded. Using SHOW only about 50 of the 300 measurements appear. Using SELECT all my queries return no results. So I try to figure out another way to do it…

Next I took the output of influx_inspect and filtered it down to just a handful of measurements that I’m interested in. I import this using influx -import and completes quickly…excellent. However, to my dismay, the same behavior happens as before…I see all the series / measurements using SHOW but no data comes back using SELECT.

What’s happening?

Here’s some output of my commands…

start of the file I’m using:

root@cde25774ae6a:/tmp# head -n10 load.txt
# DML
# CONTEXT-DATABASE: ecl
# CONTEXT-RETENTION-POLICY: autogen


incoming_feed_dealers,host=InvDEVTE09Web01,metric_type=set value=3i 1498050000000000000
incoming_feed_dealers,host=InvDEVTE09Web01,metric_type=set value=3i 1498050010000000000
incoming_feed_dealers,host=InvDEVTE09Web01,metric_type=set value=3i 1498050020000000000
incoming_feed_dealers,host=InvDEVTE09Web01,metric_type=set value=3i 1498050030000000000
incoming_feed_dealers,host=InvDEVTE09Web01,metric_type=set value=3i 1498050040000000000

I’m importing the file:

root@cde25774ae6a:/tmp# influx -import -path=load.txt
2017/06/23 01:55:51 Processed 100000 lines.  Time elapsed: 1.931504192s.  Points per second (PPS): 51773
2017/06/23 01:55:53 Processed 200000 lines.  Time elapsed: 4.032506818s.  Points per second (PPS): 49596
2017/06/23 01:55:55 Processed 300000 lines.  Time elapsed: 6.722230422s.  Points per second (PPS): 44628
2017/06/23 01:55:59 Processed 400000 lines.  Time elapsed: 10.407828107s.  Points per second (PPS): 38432
2017/06/23 01:56:04 Processed 500000 lines.  Time elapsed: 15.203411772s.  Points per second (PPS): 32887
2017/06/23 01:56:13 Processed 600000 lines.  Time elapsed: 24.275056461s.  Points per second (PPS): 24716
2017/06/23 01:56:18 Processed 0 commands
2017/06/23 01:56:18 Processed 630266 inserts
2017/06/23 01:56:18 Failed 0 inserts

i can see series exist:

C02Q940XG8WM:~ bmoseley$ influx -database ecl -execute "show series limit 25"
key
---
db_query,db=mongo,host=InvStageAWeb01,metric_type=timing,table=incoming_feed,type=save
db_query,db=mongo,host=blayne.web.local,metric_type=timing,table=user_setting,type=find_first
db_query,db=mysql,host=InvDEVTE02App01,layer=unknown,metric_type=timing,success=1,table=incoming_feed_data_sets,type=select
db_query,db=mysql,host=InvDEVTE02Web01,layer=unknown,metric_type=timing,success=1,table=incoming_feed_data_sets,type=select
db_query,db=mysql,host=InvDEVTE02Web01,layer=unknown,metric_type=timing,success=1,table=incoming_feed_filter_sets,type=select
db_query,db=mysql,host=InvDEVTE02Web01,layer=unknown,metric_type=timing,success=1,table=incoming_feeds,type=select
db_query,db=mysql,host=InvDEVTE04Web01,layer=unknown,metric_type=timing,success=1,table=incoming_feed_data_sets,type=select
db_query,db=mysql,host=InvDEVTE09Web01,layer=unknown,metric_type=timing,success=1,table=incoming_feed_data_sets,type=select
db_query,db=mysql,host=InvStageAWeb01,layer=unknown,metric_type=timing,success=1,table=incoming_feed_data_sets,type=select
db_query,db=mysql,host=InvStageAWeb01,layer=unknown,metric_type=timing,success=1,table=incoming_feed_filter_sets,type=select
db_query,db=mysql,host=InvStageAWeb01,layer=unknown,metric_type=timing,success=1,table=incoming_feeds,type=select

alas, no data shows up:

influx -database ecl -execute "select * from db_query limit 10"
<no result>

@Blayne_Moseley That is rather odd. What is the output of SHOW RETENTION POLICIES ON ecl?

looks like just the autogen policy, which is what I expected:

influx -database ecl -execute "show retention policies on ecl"
name	duration	shardGroupDuration	replicaN	default
----	--------	------------------	--------	-------
autogen	0s		168h0m0s		1		true

@Blayne_Moseley Would you mind opening an issue on InfluxDB? I’m not quite sure whats going on here.