Migrate db2 developer edition to new server

Here is a guide I wrote for my work, I just post it here so that I can refer to it even after I leave.

Install the same DB2 version as in DEV environment (v11.1.2.2)

IBM does not support old version of DB2 developer edition, and when new version is released, old version support is dropped and you’re not able to install them any more.

As a workaround, we need to migrate the existing DB2, which runs as a container, to new server to get the same version.

Here is the steps to migrate the container:

on existing DB2 server:

then, copy db2server.tar and the folder from 2nd command (usually /home/centos/.config/ibm-db2-hkex/DB2/db2fs or /home/centos/.config/ibm-db2-developerc/DB2/db2fs) to new server

on new server, run these commands:

logout and log back in, try ‘docker info’ to make sure your account has permission to start docker containers

create a file called ‘.env_list’, with the following content:

create a file called run_db2_container.sh, with the following content:

Note the argument to ‘-v’, make sure the folder is where you put the content copied from the old server.

then, run below command to start the container:

then, run below command to make sure container started:

update db2nodes.cfg file with new container hostname, with below commands:

edit file /home/db2inst1/sqllib/db2nodes.cfg, replace old hostname string with new one.

restart container and verify DB2 is working: