Upgrade mongodb from 3.6.3 to 4.4.4

STOP APPLICATION

BACKUP DATABASE

mongodump --username DB_USERNAME --password DB_PASSWORD --db DB_NAME --out /var/backups/mongobackups/`date +"%m-%d-%y"`

UNINSTALL OLD DATABASE

sudo systemctl stop mongodb
sudo apt-get purge mongodb-*

INSTALL NEW ONE

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu