Application Server - cws-khuntly/WebSphere GitHub Wiki


date: 2025-05-20 21:22:31 created: 2025-05-08 15:28:40 categories:

  • WebSphere / Backups

Application 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=XXX

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}/AppServer

Source setupCmdLine.sh:

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

Export the WAS_INSTALL_ROOT:

declare -x WAS_INSTALL_ROOT="/opt/IBM/WebSphere/AppServer"
 

Stop the application servers and nodeagent :

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

${USER_INSTALL_ROOT}/bin/stopNode.sh

Synchronize the node:

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

Back up configuration files:

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

Remove passwords from soap.client.props:

sed -i'' "s/com.ibm.SOAP.loginPassword=.*/com.ibm.SOAP.loginPassword=/" /opt/IBM/WebSphere/profiles/AppSrv/properties/soap.client.props

Clean up temporary files:

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

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

Back up the profiles:

${WAS_INSTALL_ROOT}/bin/manageprofiles.sh -backupProfile -profileName ${PROFILE_NAME} -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}/AppServer/WebSphere-Profiles-full-backup-${POST_PROCESS_NAME}-${BACKUP_DATE_STAMP}.tar.gz

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

Replace property files for the Portal profile:

cp ${HOME}/workspace/WebSphere/AppServer/properties/${ENV}/${PROFILE_NAME}/soap.client.props ${USER_INSTALL_ROOT}/properties/soap.client.props

Start the node agent and application servers:

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

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

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