Upgrading From MongoDB 3.0 to MongoDB 3.2

Purpose

OMK customers may wish to upgrade from MongodDB 3.0 to MongoDB to 3.2.  This example uses CentOS because this is the prevailing Linux distribution used by our customer base.

Steps

  • Ensure MondgoDB Authentication Is Set Correctly
  • Stop Running Services
  • Backup Current Database
  • Install MongoDB 3.2
  • Provision MongoDB 3.2
  • Restart OMK Services and Test

Procedure

Ensure MongoDB Authentication Is Set Correctly

In order to ensure a smooth transistion ensure MongoDB authentication is set correctly.  The following script will facilitate this.

[root@opmantek ~]# /usr/local/omk/bin/setup_mongodb.pl 

Stop Running OMK Services

 

[root@opmantek ~]# service opconfigd stop
Stopping opconfig daemon opconfigd                         [  OK  ]
[root@opmantek ~]# service opeventsd stop
Stopping opevents daemon opeventsd                         [  OK  ]
[root@opmantek ~]# service omkd stop
Stopping Opmantek Webserver opmantek.exe                   [  OK  ]
[root@opmantek ~]# service opflowd stop
Shutting down flowd:                                       [  OK  ]

 

Backup Current Database

Create Backup Directory

[root@opmantek /]# mkdir data/mongodump

Dump MongoDB

[root@opmantek ~]# mongodump -u=opUserRW -p=op42flow42 --out=/data/mongodump

Stop MongoDB

[root@opmantek ~]# service mongod stop
Stopping mongod:                                           [  OK  ]

 

Install MongoDB 3.2

Update MongoDB Repository File

In order to install Mondgo3.2 edit /etc/yum.repos.d/mongod-org.repo to reflect the correct version. 

/etc/yum.repos.d/mongod-org.repo
### change below to 3.2
[mongodb-org-3.2]
name=MongoDB Repository
### change below to 3.2
baseurl=https://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/3.2/x86_64/
gpgcheck=0
enabled=1

Install MongoDB 3.2 with yum

[root@opmantek ~]# yum install mongodb-org

Start MongoDB Service

[root@opmantek ~]# service mongod start
Starting mongod:                                           [  OK  ]
[root@opmantek ~]# 

 

Restart OMK Services and Test

Restart Services

[root@opmantek mongodb]# service opeventsd start
Starting opevents daemon opeventsd                         [  OK  ]
[root@opmantek mongodb]# service opconfigd start
Starting opconfig daemon opconfigd                         [  OK  ]
[root@opmantek mongodb]# service opflowd start
Starting opflowd:                                          [  OK  ]
[root@opmantek mongodb]# service omkd start
Starting Opmantek Webserver opmantek.exe                   [  OK  ]

Test

Log into each OMK Application via the GUI and verify the data is still there.  If everything is as it should be then delete /data/mongodump