How to clone a WebSphere 8 profile

I would like to clone an existing profile, start the server and modify it through the admin console.

I already read the IBM documentation about

manageprofiles.bat 

but the manageprofiles tool does not contain something like:

  # would be nice if a clone action exists manageprofiles.bat -clone -profileName base -targetProfileName base1 

This is what I need, and I see no way to achieve this. The tool can create, delete, back up and restore a profile.

What have i tried

  • Copy the profile directory and rename it
  • Edited paths in bin / setupCmdLine.bat
  • Added profile in AppServer / properties / profileRegistry.xml
  • Executed manageprofiles -validateAndUpdateRegistry

But the profile is still not recognized by WAS. I can verify this by doing

 manageprofiles -listProfiles 

How do you clone or copy profiles?

Is there a manual way?

If so, which files in the dir directory should be edited?

+6
source share
6 answers

solvable

Here are the steps I took to clone an existing profile.

  • Conclude that the server is turned off.
  • Copy an existing profile from Profiles/<oldProfile> to Profiles/<newProfile>
  • WAS_USER_SCRIPT update WAS_USER_SCRIPT in Profiles\<newProfile>\bin\setupCmdLine.bat
  • USER_INSTALL_ROOT update USER_INSTALL_ROOT in Profiles\<newProfile>\bin\setupCmdLine.bat
  • Update user.root property in Profiles\<newProfile>\properties\ssl.client.props
  • Replace all occurrences of <oldProfile> with <newProfile> in Profiles\<newProfile>\firststeps\firststeps.bat
  • Change AppServer\properties\profileRegistry.xml . Make a copy of <oldProfile> and update the tag values ​​with <newProfile> . It should look something like this: <profile isAReservationTicket="false" isDefault="false" name="newProfile" path=".....\Profiles\newProfile" template=".......\AppServer\profileTemplates\default"/>
  • Copy AppServer\properties\fsdb\<oldProfile>.bat to AppServer\properties\fsdb\<newProfile>.bat . This step will make the profile available to "AppServer \ bin \ manageprofiles.bat -listProfiles"
  • Edit config/cells/<cell>/nodes/<node>/variables.xml . Update path USER_INSTALL_ROOT .
  • Update the WAS_USER_SCRIPT path in AppServer\properties\fsdb\<newProfile>.bat

It worked for me. Please comment or vote to let me know if it also worked for you.

+6
source

I needed to do this today in WebSphere 8.5 Network Deployment, so I tracked it and wrote a script. This is how I do it.

Create a WebSphere profile using the GUI-based profile management tool.

Each file you create records a log file:

 C:\Program Files (x86)\IBM\WebSphere\AppServer\logs\manageprofiles\XXXX_create.log 

In the log, find the -create switch. Clean and copy this line into the script by changing or parameterizing the fields as you wish:

 SET PROFILENAME=Profile2 SET HOSTNAME=MyHostName SET WAS_BIN=C:\Program Files (x86)\IBM\WebSphere\AppServer\bin SET PROFILE_PATH=C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\%PROFILENAME% SET WAS_TEMPLATE=C:\Program Files (x86)\IBM\WebSphere\AppServer\profileTemplates\default SET WAS_CELL=%HOSTNAME%%PROFILENAME%Cell SET WAS_PORTS_FILE=C:\Program Files (x86)\IBM\WebSphere\AppServer\logs\manageprofiles\was_default_portdef.props SET A1=-create -serverName %PROFILENAME% -profileName %PROFILENAME% -cellName %WAS_CELL% -nodeName %PROFILENAME% -hostName %HOSTNAME% SET A2=-profilePath "%PROFILE_PATH%" -templatePath "%WAS_TEMPLATE%" SET A3=-applyPerfTuningSetting development -enableAdminSecurity false -winserviceCheck false -omitAction defaultAppDeployAndConfig SET A4=-portsFile "%WAS_PORTS_FILE%" SET A5=-signingCertDN "cn=10.0.2.15\\,ou=Root Certificate\\,ou=%WAS_CELL%\\,ou=%PROFILENAME%\\,o=IBM\\,c=US" -personalCertDN "cn=10.0.2.15\\,ou=%WAS_CELL%\\,ou=%PROFILENAME%\\,o=IBM\\,c=US" SET A6=-personalCertValidityPeriod 10 -signingCertValidityPeriod 15 SET WAS_ARGS=%A1% %A2% %A3% %A4% %A5% %A6% call "%WAS_BIN%\manageprofiles.bat" %WAS_ARGS% 

You will need to search for the files "C: \ Program Files (x86) \ IBM \ WebSphere \ AppServer \ logs \ manageprofiles * _portdef.props" and copy one of them for your use, just like me.

The result of my script was thus a cloned / modified version of the profile that I created earlier.

Then I ran it on the command line:

 "C:\Program Files (x86)\IBM\WebSphere\AppServer\bin\manageprofiles.bat" -create -serverName Unica9103 -profileName Unica9103 -cellName UnicaVMUnica9103Cell -nodeName Unica9103 -hostName UnicaVM -profilePat h "C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\Unica9103" -templatePath "C:\Program Files (x86)\IBM\WebSphere\AppServer\profileTemplates\default" -a pplyPerfTuningSetting development -enableAdminSecurity false -winserviceCheck false -omitAction defaultAppDeployAndConfig -portsFile "C:\Program Files (x86)\IB M\WebSphere\AppServer\logs\manageprofiles\was_default_portdef.props" -signingCertDN "cn=10.0.2.15\\,ou=Root Certificate\\,ou=UnicaVMUnica9103Cell\\,ou=Unica9103 \\,o=IBM\\,c=US" -personalCertDN "cn=10.0.2.15\\,ou=UnicaVMUnica9103Cell\\,ou=Unica9103\\,o=IBM\\,c=US" -personalCertValidityPeriod 10 -signingCertValidityPeri od 15 

Note that commas must be escaped with double backslashes or you get critical errors.

After success, you will receive the following:

INSTCONFSUCCESS: Success: Unica9103 profile now exists. For more information about this profile, refer to C: \ Program Files (x86) \ IBM \ WebSphere \ AppServer \ profiles \ Unica9103 \ logs \ AboutThisProfile.txt.

+1
source

Here is the built-in WebSphere solution. This works fine on WAS 8.5.5.3.

  • Launch the application server in the source profile
  • Run the command line utility by running the script <WAS_INSTAL_ROOT>/AppServer/profiles/<YOUR_SOURCE_PROFILE>/bin/wsadmin.sh or <WAS_INSTAL_ROOT>/AppServer/profiles/<YOUR_SOURCE_PROFILE>/bin/wsadmin.bat (computer)
  • Run the command in this utility:

    $ AdminTask exportWasprofile {-archive <PATH/TO/PROFILE/EXPORT/ARCHIVE> }

  • Create a new target profile or use an existing one and run the application server on it
  • Run the command line utility for the target profile by running the script <WAS_INSTAL_ROOT>/AppServer/profiles/<YOUR_TARGET_PROFILE>/bin/wsadmin.sh or <WAS_INSTAL_ROOT>/AppServer/profiles/<YOUR_TARGET_PROFILE>/bin/wsadmin.bat machine
  • Run the command to import the profile settings into the target profile in this utility:

    $ AdminTask importWasprofile {-archive <PATH/TO/PROFILE/EXPORT/ARCHIVE> -deleteExistingServers}

  • Run the command to save the new settings in the target profile in this utility:

    $ AdminConfig save

+1
source

I have not tested this method, but wsadmin has the following command:

createAppServerTemplate

This script creates a new application server template in your configuration. The server template is used to determine the configuration configuration for the new application server. When you create a new application server, you either select the default server template or the template that you previously created that is based on another, existing application server. The default template is used if you do not specify another template when creating the server.

You can create a template from your initial profile and create a new profile using the template.

0
source

I believe that createAppServerTemplate creates a template for the server, not the profile. Therefore, if you have already set up a profile, you can use the template to create additional servers in this profile.

Then you should use createApplicationServer to create new servers based on the template created above.

I assume that if you want to copy a profile, the best way is to write the configurations and set them in a script file.

0
source

For information only In MyEclipseBlue version 10 we can export the configuration and import of the server profile into a new profile; therefore, preserving the entire configuration.

Renee's answer is correct, but I ran into problems when starting the server in debug mode.

0
source

Source: https://habr.com/ru/post/948938/


All Articles