# Right way to update Docker 2.16.3 to 3.x

**URL:** <https://forum.mautic.org/t/right-way-to-update-docker-2-16-3-to-3-x/16442>\
**Category:** Mautic 3 - Install/Upgrade Support\
**Created:** [October 5, 2020, 10:47am UTC](https://forum.mautic.org/t/right-way-to-update-docker-2-16-3-to-3-x/16442 "2020-10-05T10:47:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alkanov](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alkanov/32/637_2.png) [@alkanov](https://forum.mautic.org/u/alkanov)\
**Post date:** [October 5, 2020, 10:47am UTC](https://forum.mautic.org/t/right-way-to-update-docker-2-16-3-to-3-x/16442/1 "2020-10-05T10:47:32Z")

</div>

What’s the current way to properly upgrade from 2.x to 3.x if you were using the official Docker composer:latest version?

I am not sure if I should spin up a new mautic:v3 container and try to connect it to our current 2.x database for it to auto upgrade? Or maybe try to upgrade from inside the 2.x container to then build a new v3 container and use the upgraded database?

In any case, there is very little mautic-docker-related talk out there and I thought we could make this post the official one for all the docker folk out there that are having a bad time with the update/upgrade process

This is the compose version I’ve been using for the last few months:

```auto
version: '2'

services:

  mauticdb:
    restart: always
    image: percona/percona-server:5.7
    container_name: mauticdb
    volumes:
      - mysql_data:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=mysecret
    command:
      --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci
    networks:
      - mautic-net

  mautic:
    restart: always
    image: mautic/mautic:latest
    container_name: mautic
    links:
      - mauticdb:mysql
    depends_on:
      - mauticdb
    ports:
      - 31279:80
    volumes:
      - mautic_data:/var/www/html
    environment:
      - MAUTIC_DB_HOST=mauticdb
      - MYSQL_PORT_3306_TCP=3306
      - MAUTIC_DB_USER=root
      - MAUTIC_DB_PASSWORD=mysecret
      - MAUTIC_DB_NAME=mautic
      - MAUTIC_RUN_CRON_JOBS=true
    networks:
      - mautic-net

volumes:
  mysql_data:
    driver: local
  mautic_data:
    driver: local
networks:
  mautic-net:
    driver: bridge

```

---

<div class="post-metadata">

**Author:** ![codes9](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/codes9/32/682_2.png) [@codes9](https://forum.mautic.org/u/codes9)\
**Post date:** [November 1, 2020, 12:05am UTC](https://forum.mautic.org/t/right-way-to-update-docker-2-16-3-to-3-x/16442/2 "2020-11-01T00:05:39Z")

</div>

Try this in the Docker Forums as it’s more a Docker related question than Mautic Specific.
