Migrating Websphere MQ 7.0.1 to IBM MQ 8.0.0.x

Hi,

Since there aren’t that many things new that i have done regarding Kafka and opensource software, i want to share with you this, not to be lost on a distant gitlab repo my IBM MQ migration steps and script.

In order to migrate an instance from an older version (without support ) to a newer version, even IBM recommended  that you leave it as is, just stop it and migrate the packages after that you can use a script which i will provide below.

First step is to stop the running queue managers using the following command:

for i in $(dspmq | cut -d'(' -f2 | cut -d')' -f1); do endmqm $i; done

If it fails and connections still remain unclosed, you can try using endmqm -i instead of endmqm. After the feedback is returned that queue managers are stopped, just to be sure, you can extra check it using a simple ps -ef | grep amq. Please check the status of the MQ listener as well, doing it with ps -ef | grep mqlsr. After you made sure everything is stopped, you can contact your AIX admin to commit the new packages. This should be checked using lslpp -l | greep mqm, an example output looks like this:

# lslpp -l | grep mqm
  mqm.base.runtime           8.0.0.6  COMMITTED  IBM WebSphere MQ Runtime for
  mqm.base.samples           8.0.0.6  COMMITTED  IBM WebSphere MQ Samples
  mqm.base.sdk               8.0.0.6  COMMITTED  IBM WebSphere MQ Base Kit for
  mqm.client.rte             8.0.0.6  COMMITTED  IBM WebSphere MQ Client for
  mqm.java.rte               8.0.0.6  COMMITTED  IBM WebSphere MQ Java Client,
  mqm.msg.en_US              8.0.0.6  COMMITTED  IBM WebSphere MQ Messages -
  mqm.server.rte             8.0.0.6  COMMITTED  IBM WebSphere MQ Server
  mqm.base.runtime           8.0.0.6  COMMITTED  IBM WebSphere MQ Runtime for

You now know you can get forward with the migration, and in that purpose you can also use the script below, it’s not bullet proof but you can change it and modify it for you needs:

#!/usr/bin/ksh
echo ". /usr/mqm/bin/setmqenv -s" >> $HOME/.profile
env | grep PATH | grep /usr/mqm/bin > /dev/null
if [ "$?" -ne "0" ];then
	export PATH=$PATH:/usr/mqm/bin
fi
SYSTEM_CRITICAL_VAL=`mqconfig | grep CRITICAL`
if [ "$?" -eq "0" ];then
	echo "System values for MQ installation are not OK, please check $SYSTEM_CRITICAL_VAL"
	exit
fi
INSTALLATION_NAME=`dspmqver | grep InstName | cut -d':' -f2 | sed 's/ //g'`
for i in $(dspmq | cut -d'(' -f2 | cut -d')' -f1);do
	echo "Queue manager ${i} is being set to installation ${INSTALLATION_NAME}"
	setmqm -m $i -n $INSTALLATION_NAME
	#echo $?
	if ([ "$?" -eq "0" ] || [ "$?" -eq "59" ]);then
		echo "Starting instance $i"
		strmqm $i
		if [ "$?" -eq "0" ];then
		sleep 10
		echo "ALTER QMGR CHLAUTH(DISABLED) " | runmqsc $i
		echo "ALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKLOCL(NONE) CHCKCLNT (NONE)" | runmqsc $i
		echo "REFRESH SECURITY TYPE(AUTHSERV)" | runmqsc $i
		echo "ALTER CHL('SYSTEM.DEF.SVRCONN') CHLTYPE(SVRCONN) MAXMSGL(104857600) HBINT(300) MAXINST(999999999) MCAUSER('mqm') SSLCAUTH(OPTIONAL) "| runmqsc $i
		endmqm -i $i
		sleep 30
		fi
	fi
done	

Once this is done, you should have been migrated to MQ 8 and can connect to it using SYSTEM.DEF.SVRCONN which has MCAUSER setup to mqm. Please keep in mind that this a temporary solution and that  IBM MQ connection policies should be enabled for channel connect (you can also opt for a different user on the server connect channel and authorize just the objects that you connector needs)

That should be all for today,

Cheers!