Portal Server - cws-khuntly/WebSphere GitHub Wiki


date: 2025-05-08 15:28:55 created: 2025-05-08 15:28:48 categories:

  • WebSphere / Backups

Portal Server

Create backup date variable:

declare -x BACKUP_DATE_STAMP=$(date +"%d-%m-%Y_%H-%M-%S")

Export the environment variable:

declare -x ENV=XXX

Export the post process name:

declare -x POST_PROCESS_NAME=XXX

Export the profile name:

declare -x PROFILE_NAME=XXX

Export the server name:

declare -x SERVER_NAME=WebSphere_Portal

Export the deployment manager hostname:

declare -x DMGR_HOSTNAME=XXX

Create the backup directory:

mkdir -pv /nfs/backup/${ENV}/profiles/${PROFILE_NAME}

mkdir -pv /nfs/backup/${ENV}/PortalServer

Source setupCmdLine.sh:

source /opt/IBM/WebSphere/profiles/${PROFILE}/bin/setupCmdLine.sh

Export the WAS_INSTALL_ROOT and CW_PROFILE_ROOT variables:

declare -x WAS_INSTALL_ROOT="/opt/IBM/WebSphere/AppServer"
declare -x CW_PROFILE_ROOT="/opt/IBM/WebSphere/AppServer/profiles/cw_profile"

Stop the application servers and nodeagent :

${USER_INSTALL_ROOT}/bin/stopServer.sh ${SERVER_NAME}

${CW_PROFILE_ROOT}/bin/stopServer.sh server1

${USER_INSTALL_ROOT}/bin/stopNode.sh

Synchronize the node:

${USER_INSTALL_ROOT}/bin/syncNode.sh ${DMGR_HOSTNAME} 8879

Back up configuration files:

cw_profile:

cp ${CW_PROFILE_ROOT}/properties/soap.client.props ${HOME}/workspace/WebSphere/AppServer/properties/${ENV}/cw_profile/soap.client.props

Portal Server profile:

cp ${USER_PROFILE_ROOT}/properties/soap.client.props ${HOME}/workspace/WebSphere/PortalServer/properties/${ENV}/${PROFILE_NAME}/soap.client.props

cp ${USER_INSTALL_ROOT}/properties/sas.client.props ${HOME}/workspace/WebSphere/PortalServer/properties/${ENV}/${PROFILE_NAME}/sas.client.props

cp ${USER_INSTALL_ROOT}/ConfigEngine/properties/wkplc.properties ${HOME}/workspace/WebSphere/PortalServer/properties/${ENV}/ConfigEngine/wkplc.properties

cp ${USER_INSTALL_ROOT}/ConfigEngine/properties/wkplc_dbdomain.properties ${HOME}/workspace/WebSphere/PortalServer/properties/${ENV}/ConfigEngine/wkplc_dbdomain.properties

cp ${USER_INSTALL_ROOT}/ConfigEngine/properties/wkplc_comp.properties ${HOME}/workspace/WebSphere/PortalServer/properties/${ENV}/ConfigEngine/wkplc_comp.properties

Remove passwords from soap.client.props:

sed -e "s/com.ibm.SOAP.loginPassword=.*/com.ibm.SOAP.loginPassword=/g" ${USER_INSTALL_ROOT}/properties/soap.client.props >| ${USER_INSTALL_ROOT}/properties/soap.client.props

sed -e "s/com.ibm.CORBA.loginPassword=.*/com.ibm.CORBA.loginPassword=/g" ${USER_INSTALL_ROOT}/properties/sas.client.props >| ${CW_PROFILE_ROOT}/properties/sas.client.props

sed -e "s/com.ibm.SOAP.loginPassword=.*/com.ibm.SOAP.loginPassword=/g" ${CW_PROFILE_ROOT}/properties/soap.client.props >| ${CW_PROFILE_ROOT}/properties/soap.client.props

Clean up ConfigEngine:

${USER_INSTALL_ROOT}/ConfigEngine/ConfigEngine.sh cleanup-work-dir

${USER_INSTALL_ROOT}/ConfigEngine/ConfigEngine.sh delete-passwords

Clean up temporary files:

rm -rf ${USER_INSTALL_ROOT}/temp/* ${USER_INSTALL_ROOT}/wstemp/*

rm -rf ${CW_PROFILE_ROOT}/temp/* ${CW_PROFILE_ROOT}/wstemp/*

${USER_INSTALL_ROOT}/bin/clearClassCache.sh && ${USER_INSTALL_ROOT}/bin/osgiCfgInit.sh

${CW_PROFILE_ROOT}/bin/clearClassCache.sh && ${CW_PROFILE_ROOT}/bin/osgiCfgInit.sh

Back up the profiles:

${WAS_INSTALL_ROOT}/bin/manageprofiles.sh -backupProfile -profileName cw_profile -backupFile /nfs/backup/${ENV}/profiles/cw_profile/cw_profile-${POST_PROCESS_NAME}-backup.${BACKUP_DATE_STAMP};

${WAS_INSTALL_ROOT}/bin/manageprofiles.sh -backupProfile -profileName PortalProfile -backupFile /nfs/backup/${ENV}/profiles/${PROFILE_NAME}/${PROFILE_NAME}-${POST_PROCESS_NAME}-backup.${BACKUP_DATE_STAMP};

Back up the full WebSphere filesystem:

tar -C /opt/IBM/WebSphere -cvf - ./profiles | gzip > /nfs/backup/${ENV}/PortalServer/WebSphere-Profiles-full-backup-${POST_PROCESS_NAME}-${BACKUP_DATE_STAMP}.tar.gz

tar -C /opt/IBM/WebSphere -cvf - ./AppServer | gzip > /nfs/backup/${ENV}/PortalServer/WebSphere-AppServer-full-backup-${POST_PROCESS_NAME}-${BACKUP_DATE_STAMP}.tar.gz

tar -C /opt/IBM/WebSphere -cvf - ./PortalServer| gzip > /nfs/backup/${ENV}/PortalServer/WebSphere-PortalServer-full-backup-${POST_PROCESS_NAME}-${BACKUP_DATE_STAMP}.tar.gz

Replace property files:

cw_profile:

cp ${HOME}/workspace/WebSphere/AppServer/properties/${ENV}/cw_profile/soap.client.props ${CW_PROFILE_ROOT}/properties/soap.client.props

Portal Server profile:

cp ${HOME}/workspace/WebSphere/PortalServer/properties/${ENV}/${PROFILE_NAME}/soap.client.props ${USER_PROFILE_ROOT}/properties/soap.client.props

cp ${HOME}/workspace/WebSphere/PortalServer/properties/${ENV}/${PROFILE_NAME}/sas.client.props ${USER_INSTALL_ROOT}/properties/sas.client.props

cp ${HOME}/workspace/WebSphere/PortalServer/properties/${ENV}/ConfigEngine/wkplc.properties ${USER_INSTALL_ROOT}/ConfigEngine/properties/wkplc.properties

cp ${HOME}/workspace/WebSphere/PortalServer/properties/${ENV}/ConfigEngine/wkplc_dbdomain.properties ${USER_INSTALL_ROOT}/ConfigEngine/properties/wkplc_dbdomain.properties

cp ${HOME}/workspace/WebSphere/PortalServer/properties/${ENV}/ConfigEngine/wkplc_comp.properties ${USER_INSTALL_ROOT}/ConfigEngine/properties/wkplc_comp.properties

Start the node agent and application servers:

${USER_INSTALL_ROOT}/bin/syncNode.sh ${DMGR_HOSTNAME} 8879 -restart

${CW_PROFILE_ROOT}/bin/startServer.sh server1 (NOTE: only if the Configuration Wizard is needed)

${USER_INSTALL_ROOT}/bin/startServer.sh ${SERVER_NAME}

⚠️ **GitHub.com Fallback** ⚠️