How to export/import Java in dual stack systems

In this article I will cover the subject of doing a export/import of Java part of a dual stack system, task that mostly used during a system copy. I would say that is is a topic that is not documented very in detail by SAP, so I hope it will come very handy.
First of all, you have to know that for exporting the Java data, no downtime is required, this is an online task and it is done with the help of SWPM tool.

Preparations

On the target system, make a backup of the below files, as most of them will be overwritten during the import:

1. SAP profiles
2. sidadm environment profiles
3. database profiles $ORACLE_HOME/dbs and if Oracle 12c also /oracle/SID/sapprof
4. listener files from $ORACLE_HOME/network/admin

After all these files are backed up proceed with the following:

1. prepare the location for the source system Java export, no more then 5 Gb should be required
2. Download SWPM tool and extract it
3. Prepare a temporary location for the SWPM logs

export TMP=/usr/sap/SID/temp_sapinst
export TEMP=/usr/sap/SID/temp_sapinst
export TMPDIR=/usr/sap/SID/temp_sapinst
export JAVA_HOME=/usr/sap/SID/SYS/exe/jvm/sunx86_64/sapjvm_4.1.035/sapjvm_4

Export

As root run sapinst on the source system and start the export:

./sapinst SAPINST_USE_HOSTNAME=host_name SAPINST_SLP_MODE=false

Choose the export option:

Give the path to the SAP profiles:

Instances installed will be detected:

Database data is identified:

The database copy was done in this case with database tools, so this option can be selected:

Enter the location where the export will be generated:

If you want to remove the sapinst group that was added to the users:

The summary of the selections made:

Reaching the end of the export:

Import

After the system copy is completed with the help of database tools and also the postprocessing of the ABAP part was done, Java can be imported on the target system.
Prepare the environment parameters and start sapinst with root:

export TMP=/usr/sap/SID/temp_sapinst
export TEMP=/usr/sap/SID/temp_sapinst
export TMPDIR=/usr/sap/SID/temp_sapinst
export JAVA_HOME=/usr/sap/SID/SYS/exe/jvm/sunx86_64/sapjvm_4.1.035/sapjvm_4

Also some archives need to be downloaded from support portal beforehand, kits that will be requested during the import procedure: Kernel, Oracle client, Java component

./sapinst SAPINST_USE_HOSTNAME=host_name SAPINST_SLP_MODE=false

Choose the correct option:

In order to be able to customize some options, select custom:

Download the correct kernel archive for your system and select it here:

Enter the system parameters:

DNS name:

Enter the password for the users that will be created:

Select homogeneous system copy, as the system copy was already done via backup/restore with database tools:

Select database data:

Database version:

If you have Oracle 12c, hopefully installed your software with user oracle, so choose it:

Some more database related parameters:

Enter Oracle passwords:

Listener information:

Enter the path to the Oracle instant client software, that you have to download:

The database is already recovered and running, so choose the appropriate option. OPS$ users can be deleted, as SSFS is implemented:

Key phrase for secure store:

Enter the path to the Java component archive:

You can choose the system numbers for your instances:

Enter message server internal port for SCS:

J2EE_ADMIN password:

SDM password:

No need to install the webdispatcher:

Exit option that does not need to be selected:

DDIC password:

Archives will be unpacked:

If you want to remove the groups sapinst from the users:

Summary of your selections:

Import is now in progress:

Probably that during the import, you will face the following errors that are generated because the database configuration that already exist,s will be overwritten with a default one.
Copy back the old files that you saved over:

Listener files:

Oracle pfile and spfile:

After replacing the files with the old ones, the import should continue with success.

Leave a Reply

Your email address will not be published. Required fields are marked *