# Tests for upgrading rocketchat
For this test I'm using the virtual machine created in April, 2021.
I use VMware player and open appliance `/misc/mansfield/lconcha/TMP/vms/rocket-16abr21`
## Fix internet connection in VM
Since the VM is a snapshot of the actual server, I need to reconfigure the ethernet connection so I can access the internet. I'm too stupid to know how to do this trhough the CLI, so I create a user to do so with GUI.
:information_source: Use `ctrl`+`alt`+`space` in the VM to grap input, then keep `ctrl`+`alt` pressed and use `F3` to get a TTY login. Login as `root`. Find password in keepass.
useradd lconcha
passwd lconcha
Exit the `root` account, then use `ctrl`+`alt`+`F1` to go back to GUI. Now I can login as `lconcha`.
:information_desk_person: The VM in VMware player should have the adapter as `NAT`.
Go to network settings and change original configuration to DHCP.
Change from this:

To this:

Turn off/on the wired connection.
## Prepare for upgrade
### Check that rocketchat is running
Simple, open firefox and go to `localhost:3000`, and you should be greeted with the usual login page.

### Check current version
Change login to root (`su`).
Find current version with:
curl http://localhost:3000/api/info

### Install [rocketckatctl](https://docs.rocket.chat/quick-start/installing-and-updating/manual-installation/rocketchatctl)
Follow the installation instructions, easy:
bash -c "$(curl https://install.rocket.chat)"
## Upgrade `mongo` to wiredTiger
If we do a `rocketchatctl check-updates` we get a message saying we need to upgrade mongo storage engine, instructing us to go to [this link](https://docs.rocket.chat/installation/manual-installation/mongodb-mmap-to-wiredtiger-migration), so we do.
But I got stuck when trying to restart mongo, getting a SElinux error message.
Job for mongod.service failed because the control process exited with error code. See "systemctl status mongod.service" and "journalctl -xe" for details.
I follow the suggestion to use `ausearch` and `semodule` to no avail.
OK, I got it: write permissions were not set properly in `/var/lib/mongo`. chown and chgrp it to mongod.
Now that rocketchat service is up and running again, but with wiredTiger, I can see the login screen just fine.