How to upgrade influxdb from 1.7 docker to 1.8 docker without loosing old data

Influxdb 1.7 version is running in the Docker container. I want to upgrade the influxdb docker container to 1.8. I replaced the older version of the container with 1.8 influxdb docker version. I have run the container using data mount comment but its unable to load old database schemas. Can anyone guide me on how to resolve the same?

below comment used to run the container.

        docker run -d \
        -p 8086:8086 \
        -v influxdb:/var/lib/influxdb \
        -v /etc/influxdb:/etc/influxdb \
        --name influxdb \

“influxdb” is the data volume for the older version.

I am new in influxdb can anyone give suggation. Thanks in advance.