Overview

In this method, we simply export the database from the old release and import it in the new release. During this, the old database can be removed but it is best practice advise to keep the old release working on the old server just in case.

The steps for this method are simple:

Make a backup of the database or server (using mongodump)

Install the new software (preferably the latest)

Import the backup into the release (using mongorestore)

So let's get going:

Backup

As mentioned before, mongo has two types of backup:

Physical

Logical

In that method, we are using the LOGICAL one, as the physical will NOT be compatible with the new release.

This command will export all not system databases and relations in the system.

Install new release

After that install the new software, either on the same server: By deleting the old one and installing the new one OR on a new server.