Upgrading MongoDB#

The instructions on this page apply to FiftyOne users who are using the MongoDB binary that is bundled with FiftyOne.

If you utilize a custom/shared MongoDB database, then follow the upgrade path advised by your database provider.

Note

It is strongly recommended to perform a backup of your MongoDB database before upgrading your MongoDB version.

Upgrading to MongoDB 8#

  1. Close any Python sessions that are running fiftyone

  2. Ensure that the bundled mongo process has been shut down

ps -ef | egrep "fiftyone.*mongod"
  1. Upgrade to fiftyone>=1.3 and fiftyone-db>=1.2.0

    pip install --upgrade fiftyone fiftyone[db]
    
  2. Install mongosh

  3. Find the MongoDB URI using your operating system’s network libraries

sudo lsof -iTCP -sTCP:LISTEN -P -n | egrep "mongod"
  1. Connect to MongoDB using mongosh

    mongosh "$URI_FROM_ABOVE"
    
  2. Enable backwards-incompatible MongoDB 8.0 features by setting your database’s feature compatibility version

    db.adminCommand({
        setFeatureCompatibilityVersion: "8.0",
        confirm: true
    })
    
    // Verify the upgrade
    db.adminCommand({
        getParameter: 1,
        featureCompatibilityVersion: 1
    })