Upgrading mongodb has no effect and still shows the old version

后端 未结 7 1543
说谎
说谎 2020-12-29 01:51

Following are the commands which I used to upgrade my mongodb version from 2.6.9 to latest, but its still showing me the previous version. Let me know what I am doing wrong

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-29 02:16

    [Disclaimer] Before going into upgrade consider that moving from 2.6 to 3.+ requires an update on storage files. Same if you are updating from 3.2 to 3.4 or 3.4 to 3.6. Important: You can't directly upgrade from 3.2 to 3.6, for example. You must upgrade "step by step" 3.2-->3.4-->3.6. See this question/answer for details.

    This is necessary if you want to recover your old DBs

    As of writing 3.6 is the latest version of MongoDB. Some details here

    Beware that changing between versions also regards some syntax in .conf file.

    [Procedure] A more general framework for updating is to follow the typical procedure as shown here, but point to "Install a specific release of MongoDB" part of this guide as you already have MongoDB installed.

    An example on Ubuntu 14.04:

    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
    echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
    sudo apt-get update
    sudo apt-get install -y mongodb-org=3.2.18 mongodb-org-server=3.2.18 mongodb-org-shell=3.2.18 mongodb-org-mongos=3.2.18 mongodb-org-tools=3.2.18
    

提交回复
热议问题