How to export / import tokens

Hi,

Is it possible to export and import tokens in InfluxDB 2.0? If I need to move my database to another machine, is it possible to create the same tokens so all the read/write devices will still work without changing tokens in them?

Hello @szerwi,
Welcome!
Have you taken a look at the export all CLI command?
You can export any resource you want as a template and apply it to a new account:

Hi @Anaisdg,

Thank you for the answer. Are you sure that export command is capable of exporting access tokens?
On this page: Create an InfluxDB template | InfluxDB OSS 2.0 Documentation there is no information about exporting tokens.

I believe so, but I haven’t tested it:

https://docs.influxdata.com/influxdb/v2.0/reference/cli/influx/export/all/

See the -token

I think -token switch is to authenticate the command, same as in all other influx commands.

Hello @szerwi,
I was hopeful that perhaps if you used an authenticated influx config. My apologies. It looks like this isn’t possible. I encourage you to create a feature request and share it: