Migrate OpManager NCM NFA from MySQL to PostgreSQL - the complete procedure

Migrate OpManager NCM NFA from MySQL to PostgreSQL - the complete procedure

Hi,

after days of work I finally found the complete procedure to migrate the OpManager + NCM + NFA installation from MySQL to PostgreSQL.
Hope it will help other people. Feel free to thank me :-)

Situation

·         Server Operating System: Windows 2008 R2 64bit

·         Hard Drive

o   C:\ Operating System

o   D:\ManageEngine\OpManager installation folder

·         Installed Software

o   OpManager version 11300 64bit upgraded from previous releases

o   NCM plug-in version 5960 upgraded from previous releases

o   NFA plug-in version 9860 64bit upgraded from previous releases

·         DB MySQL embedded

Procedure

Backup

1-      OpManager(MySQL) running

2-      Stop OpManager(MySQL) services

3-      take the complete copy of the customer original OpManager folder and name is as OpManager-BKP

4-      Start OpManager(MySQL) services

5-      CD OpManager\bin\backup

6-      run the script "BackupDB.bat -targetdb pgsql"
NOTE: it DOESN’T take backups for the NCM and NFA plug-in

7-      CD OpManager\NetFlow\troubleshooting

8-      run the script "backupConfig.bat"
NOTE: it only takes the configuration backup – you will lose the historical data

9-      Stop OpManager(MySQL) services

10-   Now you should have two folders: OpManager-BKP and OpManager (OPMAN~1)

Install PostgreSQL version

11-   Rename OpManager folder to OpManager-MYSQL (OPMAN~1)

12-   Change also the Microsoft Folder Short name from OPMAN~1 to OPMAN~3

13-   Installed a brand new OpManager with embedded PostgreSQL + NCM + NFA (same build as customer) on the same folder

14-   Check and rename the Microsoft Folder Short name to OPMAN~1

15-   Start the software and verify if everything works fine
NOTE: now you should have an empty OpManager+NCM+NFA installation with PostgreSQL DB

Restore OpManager (config+data) and NFA (only config)

16-   Now you should have three folders: OpManager-BKP, OpManager (OPMAN~1) and OpManager-MySQL (OPMAN~3)

17-   Stop the OpManager (PgSQL) services

18-   Move the two backups (OpManager + NFA) you took before to the respective backup directory of the NEW installation
NOTE: you should have trouble to restore the data if the backups are not there

19-   CD OpManager\bin\backup

20-   run the script "RestoreDB.bat <name of the file>"

21-   CD <OpManager\NetFlow\troubleshooting\>

22-   run the script "restoreConfig.bat"

23-   Start the OpManager services

24-   Now you can check the software. Everything should works fine BUT you will not have any data in the NCM plug-in

Restore NCM data

The only way to import the old NCM configuration and data is to run an interactive script that takes each table on the old MySQL DB and create a new table in the PgSQL. In order to do that you should have BOTH the DB running at the same time. The problem is that both use the same TCP port 13306, so you have to change the port number of PgSQL (it’s simpler)

25-   Stop the OpManager (PgSQL) service

26-   Found on the file “OpManager\bin\startPgSQL.bat” that the PgSQL DB is using the non-standard port 13306

27-   Changed the PgSQL port to 13307 in the file “OpManager\bin\startPgSQL.bat”

28-   CD to “OpManager\pgsql\data” directory and edit the file named “pg_hba.conf” using WordPad (take a copy first)

29-   You will find the line “host          all           all           127.0.0.1/32       trust”

30-   Below that ADD the line “host  all           all           0.0.0.0/0              trust”

31-   Save the file

32-   CD to OpManager\bin

33-   Edit the file named “postgresql.conf” using WordPad (take a copy first)

34-   You will find the line “ #listen_addresses = 'localhost'        # what IP address(es) to listen on;”

35-   CHANGE the line as “listen_addresses = '*'”
Note that you should not have # in front of the line

36-   Save the file

37-   Start ONLY the PgSQL DB: OpManager\bin\startPgSQL.bat

38-   Take a breath J

39-   Open a command prompt and CD in the original MySQL installation server and navigate to “OpManager-MYSQL/ncm/bin” directory

40-   Open “MigrateFromMySqlToPGSQL.bat” file using WordPad and edit -Xmx2448m to -Xmx1024m – Save it

41-   Run the command MigrateFromMySqlToPGSQL.bat. The data you need are:

a.       Enter pgsql Server ipaddress:-127.0.0.1

b.      pgsql Port number:-13307

c.       Enter the pgsql Username:-postgres

d.      Enter pgsql Password:- postgres (it’s hidden)

e.      Enter pgsql DB Name:-deviceexpert

42-   This script will automatically launch the MySQL DB on port 13306 while the PgSQL DB is already running on port 13307

43-   The script will restore the config and the data and then it stops the MySQL DB

44-   Stop the PgSQL: OpManager\bin\stopPgSQL.bat

45-   Restore the original PgSQL port to 13306

46-   Start OpManager

END !!!

                New to ADSelfService Plus?