Percona Mongo 4.0 on Ubuntu 22.04 LTS AMD64

Hi there,

I have 3 bare metal servers running Ubuntu 20.04 LTS AMD64, finally I will upgrade very soon to Ubuntu 22.04 LTS - AMD64. The current version of Mongo running as ReplicaSet is v3.6. I’d like to upgrade to version 4.0 but I cannot find any apt repo that way I can do that?

I have another single Ubuntu 22.04 LTS AMD64 box, and I installed Percona MongoDB 4.4 but the databases are incompatibles.

Help me Obi-Wan Kenobi, you are my only hope.

Hi @jbiancot
Percona Server for MongoDB 4.0 is EOL, but the packages for Ubuntu 20.04 are still available from our repo.

First you need to install our “percona-release” repository management tool as described here - Install percona-release - Percona Software Repositories

Once done, you can enable psmdb-40 repo using the following command:

percona-release enable psmdb-40 release

And install percona-server-mongodb (4.0.28-23.focal) as usual by running:

apt install percona-server-mongodb
percona-server-mongodb installation console output
root@8d6c8890965c:/# percona-release enable psmdb-40 release
* Enabling the Percona Server for MongoDB 4.0 repository
Hit:1 http://repo.percona.com/pmm2-client/apt focal InRelease
Hit:2 http://repo.percona.com/prel/apt focal InRelease
Get:3 http://repo.percona.com/psmdb-40/apt focal InRelease [15.7 kB]
Hit:4 http://repo.percona.com/telemetry/apt focal InRelease
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:7 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:8 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Get:9 http://repo.percona.com/psmdb-40/apt focal/main Sources [2018 B]
Get:10 http://repo.percona.com/psmdb-40/apt focal/main amd64 Packages [6238 B]
Fetched 24.0 kB in 1s (22.6 kB/s)
Reading package lists... Done
root@8d6c8890965c:/# apt info percona-server-mongodb
Package: percona-server-mongodb
Version: 4.0.28-23.focal
Priority: extra
Section: database
Maintainer: Percona Development Team <opensource-dev@percona.com>
...
root@8d6c8890965c:/# apt install percona-server-mongodb
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libpcap0.8 libsasl2-modules-gssapi-mit percona-server-mongodb-mongos percona-server-mongodb-server percona-server-mongodb-shell percona-server-mongodb-tools
The following NEW packages will be installed:
  libpcap0.8 libsasl2-modules-gssapi-mit percona-server-mongodb percona-server-mongodb-mongos percona-server-mongodb-server percona-server-mongodb-shell percona-server-mongodb-tools
0 upgraded, 7 newly installed, 0 to remove and 21 not upgraded.
Need to get 66.4 MB of archives.
After this operation, 269 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 libpcap0.8 amd64 1.9.1-3 [128 kB]
...
root@8d6c8890965c:/# mongod --version
db version v4.0.28-23
git version: 5780a7abf1ccd8874cf9a597ec2d914ecce10249
OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020
allocator: tcmalloc
modules: none
build environment:
    distarch: x86_64
    target_arch: x86_64

Thanks Alex but I have another issue, one of the servers I’ve upgraded to Ubuntu 22.04 LTS, I am getting a message the repo is not supported for the OS?

It must be a way to install Mongo 4.0 to Ubuntu 22.04?

My goal is to catch-up with version +5.0, but how I can skip the upgrade of 4.0 to 4.2 to 4.4 to 5.0?

The data was originally from Percoan Mongo 3.6 which I was able to upgrade to version 4.0 on another Production ENV servers, on this server which is a standalone with Ubuntu 22.04 LTS, the installation went for Percona Mongo 4.4 and when I tried to start the MongoDB service, it didn’t like the 200 GB of data I have.

[root@furious /tmp]  curl -O https://repo.percona.com/apt/percona-release_latest.generic_all.deb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16510  100 16510    0     0  77947      0 --:--:-- --:--:-- --:--:-- 78246

[root@furious /tmp]   apt install gnupg2 lsb-release ./percona-release_latest.generic_all.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'percona-release' instead of './percona-release_latest.generic_all.deb'
lsb-release is already the newest version (11.1.0ubuntu4).
gnupg2 is already the newest version (2.2.27-3ubuntu2.1).
percona-release is already the newest version (1.0-29.generic).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

[root@furious /tmp]  apt update
Hit:1 http://download.virtualbox.org/virtualbox/debian jammy InRelease
Hit:2 http://es.archive.ubuntu.com/ubuntu jammy InRelease                                                   
Hit:3 http://es.archive.ubuntu.com/ubuntu jammy-updates InRelease                                           
Hit:4 http://es.archive.ubuntu.com/ubuntu jammy-backports InRelease        
Hit:5 http://security.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
...

[root@furious /tmp]  percona-release enable psmdb-40 release
Specified repository is not supported for current operating system!

Hi @jbiancot
Regarding:

To upgrade to v5.0, it’s always recommended to upgrade to each version of Mongo for data consistency/compatibility, i.e. 4.0 → 4.2 → 4.4 → 5.0.

However, we suggest going through our well written blog about upgrade How to Upgrade MongoDB Using Backups Through Many Major Versions (percona.com) but again, you must successively upgrade to each major releases till v5.0.

Thanks,
Mukesh

Hi,

My question remains, It must be a way to install Percona Mongo 4.0 to Ubuntu 22.04?

HI @jbiancot
The issue here is that the latest release of Percona Server for MongoDB 4.0 was released on February 23, 2022 - Percona Server for MongoDB 4.0.28-23 — Percona Server for MongoDB 4.0 Documentation and Ubuntu 22.04(Jammy) was issued two months later in April 2022, so no packages were built for this version of Ubuntu.