Converting Docker Influx 1.8 to 2.0

Hello,
I am relative new to influxdb, e.g. my influx was working quite well and I did not change much, so I’m not well trained.
I have a docker-compose file with Influx (1.8) and grafana wich I want to convert to Influx 2.0. I read the docs how to do that, but I don’t understand them completely. My influx 1.8 compose file looks like this:

version: '2'

networks:
 influx:
  external: true

services:
  influxdb:
    image: influxdb:1.8
    container_name: influxdb
    ports:
     - 8086:8086
     - 8088:8088
     - 8087:8087
    volumes:
     - /opt/influxdb:/var/lib/influxdb
    restart:
     always
    networks:
     - influx


  grafana:
    image: grafana/grafana
    container_name: grafana
    ports:
     - 3000:3000
    volumes:
     - /opt/influxdb/grafana/var/lib/grafana:/var/lib/grafana
     - /opt/influxdb/grafana/etc/grafana:/etc/grafana
    restart:
     always
    networks:
     - influx

then I changed the compose file like I understood from the docs:

services:
  influxdb:
    image: influxdb:2.0
    container_name: influxdb
    ports:
     - 8086:8086
     - 8088:8088
     - 8087:8087
    volumes:
     - /opt/influxdb:/var/lib/influxdb
     - /opt/influxdb/influxdb:/var/lib/influxdb2
     - /opt/influxdb/influxdb:/etc/influxdb2
    environment:
     - DOCKER_INFLUXDB_INIT_MODE=upgrade
     - DOCKER_INFLUXDB_INIT_USERNAME=admin
     - DOCKER_INFLUXDB_INIT_PASSWORD=asdfghj
     - DOCKER_INFLUXDB_INIT_ORG=4ma
     - DOCKER_INFLUXDB_INIT_BUCKET=bucket1
     - DOCKER_INFLUXDB_INIT_UPGRADE_V1_CONFIG=/etc/influxdb/influxdb.conf
    restart:
     always
    networks:
     - influx

But the converting of the data soesn’t work. In the logs it is said, the password is to short:

{"level":"info","ts":1619285176.6210938,"caller":"upgrade/upgrade.go:395","msg":"Starting InfluxDB 1.x upgrade"}

{"level":"info","ts":1619285176.6212215,"caller":"upgrade/upgrade.go:409","msg":"No InfluxDB 1.x config file specified, skipping its upgrade"}

{"level":"info","ts":1619285176.6213849,"caller":"upgrade/upgrade.go:412","msg":"Upgrade source paths","meta":"/var/lib/influxdb/meta","data":"/var/lib/influxdb/data"}

{"level":"info","ts":1619285176.621426,"caller":"upgrade/upgrade.go:413","msg":"Upgrade target paths","bolt":"/var/lib/influxdb2/influxd.bolt","engine":"/var/lib/influxdb2/engine"}

{"level":"info","ts":1619285176.6296387,"caller":"bolt/bbolt.go:76","msg":"Resources opened","service":"bolt","path":"/var/lib/influxdb2/influxd.bolt"}

{"level":"info","ts":1619285176.6301496,"caller":"migration/migration.go:153","msg":"Bringing up metadata migrations","service":"migrations","migration_count":14}

Error: password is too short

I tried to change the password in the 1.8 container, but the commands from the docs won’t work:

influx user password -n admin

What am I doing wrong??
Any help appreciated, Thanks in advance,
Ingo

That command updates the password for 2.x.
Have you tried influx v1 auth set-password | InfluxDB OSS 2.0 Documentation?

Maybe @scott do you have some input? Or guides you can share? Thank you.

@DieSonneBlendet The influx user password -n admin is for updating passwords in InfluxDB 2.0, not 1.8. In 1.8, you manage users with these commands: Authentication and authorization in InfluxDB | InfluxDB OSS 1.8 Documentation

Do you have auth enabled in your your 1.8 instance? 2.0 requires authentication and the automated upgrade process will migrate any existing users.

@dan-moran Do you know what would cause this error during a 1.8 to 2.0 migration in Docker?

Sorry for not comming back, I was busy an forgot to. At the moment, I son’t have time to work on, I will come back as soon as I get time to.
Thanks for your help!
Ingo