# Cannot upgrade mender server from v2.4.0 to v2.6.1 - mongo container is “restarting”

**URL:** <https://hub.mender.io/t/cannot-upgrade-mender-server-from-v2-4-0-to-v2-6-1-mongo-container-is-restarting/3614>\
**Category:** General Discussions\
**Created:** [May 10, 2021, 4:16am UTC](https://hub.mender.io/t/cannot-upgrade-mender-server-from-v2-4-0-to-v2-6-1-mongo-container-is-restarting/3614 "2021-05-10T04:16:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohita83](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/rohita83/32/436_2.png) [@Rohita83](https://hub.mender.io/u/Rohita83)\
**Post date:** [May 10, 2021, 4:16am UTC](https://hub.mender.io/t/cannot-upgrade-mender-server-from-v2-4-0-to-v2-6-1-mongo-container-is-restarting/3614/1 "2021-05-10T04:16:20Z")

</div>

After the upgrade from mender server open source 2.4.0 to 2.6.1, the mongo container is restarting:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/2X/4/4098436d1c364deb6c9796b640070645c7f92660.png)

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/2X/f/f17a70ac811f09a34ae23c41e5e2c35bed0675cc.png)

Obviously, also other containers restart because they are not able to connect with mongo.

can anyone assist me to resolve the above issue?

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [May 10, 2021, 7:33am UTC](https://hub.mender.io/t/cannot-upgrade-mender-server-from-v2-4-0-to-v2-6-1-mongo-container-is-restarting/3614/2 "2021-05-10T07:33:52Z")

</div>

Did you upgrade 2.4 to 2.5 first?

From 2.4 to 2.5 there are some migrating steps to perform, mongo being one.

[https://docs.mender.io/2.5/server-installation/upgrading](https://docs.mender.io/2.5/server-installation/upgrading)

---

<div class="post-metadata">

**Author:** ![Rohita83](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/rohita83/32/436_2.png) [@Rohita83](https://hub.mender.io/u/Rohita83)\
**Post date:** [May 10, 2021, 7:58am UTC](https://hub.mender.io/t/cannot-upgrade-mender-server-from-v2-4-0-to-v2-6-1-mongo-container-is-restarting/3614/3 "2021-05-10T07:58:45Z")

</div>

> [@dellgreen](#):
>
> Did you upgrade 2.4 to 2.5 first?

No. our devices are running with mender server v2.4. and i want to upgrade them into mender server v2.6 with same dns & server certification.

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [May 10, 2021, 8:01am UTC](https://hub.mender.io/t/cannot-upgrade-mender-server-from-v2-4-0-to-v2-6-1-mongo-container-is-restarting/3614/4 "2021-05-10T08:01:48Z")

</div>

Ah I see, you need to upgrade to 2.5 first and follow the migration steps in the link above.

Mender doesn’t support jumping over a version when upgrading. I believe you can jump over bug release version numbers, but to be honest I upgrade and test in a VM each bug release version before repeating with the production server.

---

<div class="post-metadata">

**Author:** ![Rohita83](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/rohita83/32/436_2.png) [@Rohita83](https://hub.mender.io/u/Rohita83)\
**Post date:** [May 11, 2021, 1:45pm UTC](https://hub.mender.io/t/cannot-upgrade-mender-server-from-v2-4-0-to-v2-6-1-mongo-container-is-restarting/3614/5 "2021-05-11T13:45:42Z")

</div>

@dellgreen  
I have upgraded v2.4 to v2.6 with the same DNS & server certification file (e.g. server.crt) successfully by modifying a **docker-compose.yml** file **mender-mongo version from 4.4. to 4.0** and then execute the getParameter command for checkings as below

```
~/mender-server/production$ sudo docker exec -it menderproduction_mender-mongo_1 mongo --eval "db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )"
MongoDB shell version v4.0.24
connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("99b12cbd-6ac4-442d-ad30-7f4538c1d341") }
MongoDB server version: 4.0.24
{ "featureCompatibilityVersion" : { "version" : "3.6" }, "ok" : 1 }

```

![image](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/2X/3/345f0af43941509dca1ffc63c926425ac69efc44.png)

Then execute the below commands

sudo ./run pull  
sudo ./run stop  
sudo ./run rm  
sudo ./run up -d  
sudo ./run ps

```
~/mender-server/production$ sudo ./run up -d
Creating menderproduction_mender-mongo_1 ... done
Creating menderproduction_mender-nats_1 ... done
Creating menderproduction_mender-gui_1 ... done
Creating menderproduction_minio_1 ... done
Creating menderproduction_mender-workflows-worker_1 ... done
Creating menderproduction_mender-create-artifact-worker_1 ... done
Creating menderproduction_mender-workflows-server_1 ... done
Creating menderproduction_mender-useradm_1 ... done
Creating menderproduction_mender-deviceconnect_1 ... done
Creating menderproduction_mender-inventory_1 ... done
Creating menderproduction_mender-device-auth_1 ... done
Creating menderproduction_storage-proxy_1 ... done
Creating menderproduction_mender-deployments_1 ... done
Creating menderproduction_mender-api-gateway_1 ... done
```

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [May 11, 2021, 2:48pm UTC](https://hub.mender.io/t/cannot-upgrade-mender-server-from-v2-4-0-to-v2-6-1-mongo-container-is-restarting/3614/6 "2021-05-11T14:48:43Z")

</div>

Hi @Rohita83 we only test single version upgrades so recommend that you first update to 2.5 and then to 2.6. It’s possible skipping versions will work but we cannot confirm.  
Drew
