# FLUX vs. InfluxQL

**URL:** <https://community.grafana.com/t/flux-vs-influxql/57937>\
**Category:** InfluxDB\
**Created:** [December 20, 2021, 8:46am UTC](https://community.grafana.com/t/flux-vs-influxql/57937 "2021-12-20T08:46:41Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![seqway](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@seqway](https://community.grafana.com/u/seqway)\
**Post date:** [December 20, 2021, 8:46am UTC](https://community.grafana.com/t/flux-vs-influxql/57937/1 "2021-12-20T08:46:42Z")

</div>

Hello,

i migrated from Influx 1.x to 2.1.1. which has a total different structure.

Is there still a possibility to connect via InfluxQL to DB 2.x ?  
Why am I asking ? Because A L L my plots now are empty and I have to change all of them manually if I have to use FLUX instead of QL !

An answer is highly appreciated

---

<div class="post-metadata">

**Author:** ![grant2](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/grant2/32/42281_2.png) [@grant2](https://community.grafana.com/u/grant2)\
**Post date:** [December 20, 2021, 10:49am UTC](https://community.grafana.com/t/flux-vs-influxql/57937/2 "2021-12-20T10:49:25Z")

</div>

Looks like you are surprised (and not in a good way) at what happened when you selected Flux in this dialog box? Can you go back and change it?

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/9/c/9cabf4e21e2ee8cf919e029ac96993f1e1f0f07f.png)

FWIW, as complicated as Flux looks, it’s not that bad if you use the InfluxDB Data Explorer to build the query using their GUI (using checkboxes and such). Then, when you have the results you want, toggle to the Flux editor mode and it’s just a matter of copying / pasting the Flux query into Grafana.

---

<div class="post-metadata">

**Author:** ![seqway](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@seqway](https://community.grafana.com/u/seqway)\
**Post date:** [December 20, 2021, 11:08am UTC](https://community.grafana.com/t/flux-vs-influxql/57937/3 "2021-12-20T11:08:53Z")

</div>

I am not really surprised that FLUX works differently.

My problem is that I CANT CONNECT ANY LONGER with InfluxQL to my Influx2 DB ! It seems only to be possible with FLUX now.  
There my question hoot to connect with QL to Influx2 ???  
If there is a way I have still all my plots available 🙂 that would be great !

---

<div class="post-metadata">

**Author:** ![grant2](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/grant2/32/42281_2.png) [@grant2](https://community.grafana.com/u/grant2)\
**Post date:** [December 20, 2021, 11:10am UTC](https://community.grafana.com/t/flux-vs-influxql/57937/4 "2021-12-20T11:10:03Z")

</div>

Does the dialog box that I showed appear in your Data Sources?

---

<div class="post-metadata">

**Author:** ![seqway](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@seqway](https://community.grafana.com/u/seqway)\
**Post date:** [December 20, 2021, 11:19am UTC](https://community.grafana.com/t/flux-vs-influxql/57937/5 "2021-12-20T11:19:32Z")

</div>

Yes I have this dialog box

---

<div class="post-metadata">

**Author:** ![grant2](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/grant2/32/42281_2.png) [@grant2](https://community.grafana.com/u/grant2)\
**Post date:** [December 21, 2021, 2:05am UTC](https://community.grafana.com/t/flux-vs-influxql/57937/6 "2021-12-21T02:05:33Z")

</div>

If you have that dialog box, but changing the selection to InfluxQL does not make your graphs re-appear, then I afraid you went down a one-way path by choosing Flux and it wiped out your InfluxQL queries. I believe you will either have to rebuild your graphs using InfluxQL or Flux (your choice).

---

<div class="post-metadata">

**Author:** ![seqway](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@seqway](https://community.grafana.com/u/seqway)\
**Post date:** [December 21, 2021, 9:47am UTC](https://community.grafana.com/t/flux-vs-influxql/57937/7 "2021-12-21T09:47:24Z")

</div>

No, it is a bit different:

Putting the system to InfluxQL I DO NOT get a connection ti my Influx2 !  
It always says bad request. The question is how I have QL to configure to connect now to InfluxDB 2 ??? There is not documentation about that.

---

<div class="post-metadata">

**Author:** ![grant2](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/grant2/32/42281_2.png) [@grant2](https://community.grafana.com/u/grant2)\
**Post date:** [December 21, 2021, 10:35am UTC](https://community.grafana.com/t/flux-vs-influxql/57937/8 "2021-12-21T10:35:47Z")

</div>

OK, so there may be some hope, but like you said, it’s not well documented anywhere.

[From InfluxDB](https://docs.influxdata.com/influxdb/v2.1/query-data/influxql/)…

In InfluxDB 1.x, data is stored in [databases](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#database) and [retention policies](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp). In InfluxDB OSS 2.1, data is stored in [buckets](https://docs.influxdata.com/influxdb/v2.1/reference/glossary/#bucket). Because InfluxQL uses the 1.x data model, a bucket must be mapped to a database and retention policy (DBRP) before it can be queried using InfluxQL.

[This thread](https://community.influxdata.com/t/how-to-connect-grafana-to-influxdbv2-by-influxql-method/17377) has a lot of back and forth, but in the end they get it working.

---

<div class="post-metadata">

**Author:** ![seqway](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@seqway](https://community.grafana.com/u/seqway)\
**Post date:** [December 21, 2021, 11:12am UTC](https://community.grafana.com/t/flux-vs-influxql/57937/9 "2021-12-21T11:12:19Z")

</div>

I tried it already but without any success ☹ it always comes: Bad Request  
The thing is that I want to connect to a Influx2 database and why to use a mapping for influx v1 ??? This all is not working for me  
I don’t Know what to do ☹

---

<div class="post-metadata">

**Author:** ![grawiku](https://avatars.discourse-cdn.com/v4/letter/g/f05b48/32.png) [@grawiku](https://community.grafana.com/u/grawiku)\
**Post date:** [December 22, 2021, 10:08am UTC](https://community.grafana.com/t/flux-vs-influxql/57937/10 "2021-12-22T10:08:40Z")

</div>

If you already fall in big troubles please consider migration InfluxQL → VictoriaMetrics ([GitHub - VictoriaMetrics/VictoriaMetrics: VictoriaMetrics: fast, cost-effective monitoring solution and time series database](https://github.com/VictoriaMetrics/VictoriaMetrics)). It doesn’t support FluxQL neither InfluxQL, but:

- has much better performance
- supports Influx protocol for incomming data
- uses MetricsQL ([MetricsQL · VictoriaMetrics](https://docs.victoriametrics.com/MetricsQL.html)) which is extended PromQL

If you find VictoriaMetrics is not for you, you may try to translate you InfluxQL queries to FluxQL using deprecated influx transpile ([influx transpile | InfluxDB Cloud Documentation](https://docs.influxdata.com/influxdb/cloud/reference/cli/influx/transpile/))

---

<div class="post-metadata">

**Author:** ![grawiku](https://avatars.discourse-cdn.com/v4/letter/g/f05b48/32.png) [@grawiku](https://community.grafana.com/u/grawiku)\
**Post date:** [December 22, 2021, 10:12am UTC](https://community.grafana.com/t/flux-vs-influxql/57937/11 "2021-12-22T10:12:19Z")

</div>

This option is for 1.8.x version, which supports both QL, I mean InfluxQL and FluxQL. As far as I know 2.x.x supports only FluxQL.

---

<div class="post-metadata">

**Author:** ![dimejifatona](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@dimejifatona](https://community.grafana.com/u/dimejifatona)\
**Post date:** [September 18, 2022, 8:38pm UTC](https://community.grafana.com/t/flux-vs-influxql/57937/12 "2022-09-18T20:38:50Z")

</div>

I think the issue is the authentication method.

InfluxDbB 1.x uses user name and certificates. and InfluxQL

If you switch to INflux DB 2.x it uses an API Token to connect.  
The api token would be generated in Influx DB and pasted in your Grafana Influx DB settings

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [September 18, 2022, 10:27pm UTC](https://community.grafana.com/t/flux-vs-influxql/57937/13 "2022-09-18T22:27:40Z")

</div>

Using influx cli, you can convert buckets to x-db and x-rp

Dont you have a backup of your old db?

---

<div class="post-metadata">

**Author:** ![huskey108](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/huskey108/32/26797_2.png) [@huskey108](https://community.grafana.com/u/huskey108)\
**Post date:** [October 17, 2022, 7:59pm UTC](https://community.grafana.com/t/flux-vs-influxql/57937/14 "2022-10-17T19:59:36Z")

</div>

There appears to be a bug in Grafana with the influxQL datasource. I had the same issue, and reverted to Grafana version 9.0.6 which works.
