René Link
René Link

Reputation: 51323

How to clone a WebSphere 8 profile

I would like to clone an existing profile, start the server and modify it via 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 don't see a way to achieve this. The tool can create, delete, backup and restore a profile.

What I already tried

  1. Copied the profile directory and renamed it
  2. Edited the paths in the bin/setupCmdLine.bat
  3. Added the profile to the AppServer/properties/profileRegistry.xml
  4. Executed manageprofiles -validateAndUpdateRegistry

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

manageprofiles -listProfiles

How do you clone or copy profiles?

Is there a manual way?

If so, which files in the profile's dir must be edited?

Upvotes: 9

Views: 21083

Answers (7)

Adopted Idiots
Adopted Idiots

Reputation: 327

\WebSphere8552\AppServer\properties\fsdb\AppSrv01.bat change was_user_script path \WebSphere8552\AppServer\properties\fsdb_was_profile_defauldefault.bat change was_user_script path with actual

Also change path in : \AppServer\properties\profileRegistry.xml for validating license

Upvotes: 0

user3243105
user3243105

Reputation: 81

Here is a build-in WebSphere solution. This works fine on WAS 8.5.5.3.

  1. Run your application server in source profile
  2. Run command line utility by running script <WAS_INSTAL_ROOT>/AppServer/profiles/<YOUR_SOURCE_PROFILE>/bin/wsadmin.sh or <WAS_INSTAL_ROOT>/AppServer/profiles/<YOUR_SOURCE_PROFILE>/bin/wsadmin.bat (on Windows machines)
  3. Execute command in this utility:

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

  4. Create new target profile or use existing and run application server on it
  5. Run command line utility for target profile by running script <WAS_INSTAL_ROOT>/AppServer/profiles/<YOUR_TARGET_PROFILE>/bin/wsadmin.sh or <WAS_INSTAL_ROOT>/AppServer/profiles/<YOUR_TARGET_PROFILE>/bin/wsadmin.bat (on Windows machines)
  6. Execute command to import profile settings into target profile in this utility:

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

  7. Execute command to save new settings into target profile in this utility:

    $AdminConfig save

Upvotes: 6

Roberto Olivares
Roberto Olivares

Reputation: 1143

I needed to do this today on WebSphere 8.5 Network Deployment, so I tracked it down and wrote a script. Here's how I do it.

Create a WebSphere profile using the GUI based Profile Management Tool.

Each one you create will write a log file to:

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

In the log, look for the -create switch. Clean up and copy that line into a script, modifying 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 look for the "C:\Program Files (x86)\IBM\WebSphere\AppServer\logs\manageprofiles*_portdef.props" files and copy one of them for your use as I did.

The output of my script was thus a cloned/tweaked version of a profile I had created before.

I then ran it at the commandline:

"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

Notice that the commas need to be escaped with double backslashes or you get cryptic errors.

You will get something like the following on success:

INSTCONFSUCCESS: Success: Profile Unica9103 now exists. Please consult C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\Unica9103\logs\AboutThisProfile.txt for more information about this profile.

Upvotes: 1

Raichu
Raichu

Reputation: 107

Just for information In MyEclipseBlue version 10 we can export server profile configuration & import in new profile; hence retaining all the configuration.

René answer is correct but i faced issues while Running the server in Debug Mode.

Upvotes: 0

user3123032
user3123032

Reputation: 511

I believe that createAppServerTemplate creates e template for the server not the profile. Therefore if you already have configured a profile you can than use the template to create additional servers within this profile.

You would then use createApplicationServer to create new servers based on the above created template.

I guess if you want to copy a profile the best method is to record the configurations and set them in a script file.

Upvotes: 0

Ren&#233; Link
Ren&#233; Link

Reputation: 51323

Solved

Here are the manual steps that I did to clone an existent profile.

  1. Make shure that the server is shutdown.
  2. Copy the existent profile from Profiles/<oldProfile> to Profiles/<newProfile>
  3. Update Path WAS_USER_SCRIPT in Profiles\<newProfile>\bin\setupCmdLine.bat
  4. Update Path USER_INSTALL_ROOT in Profiles\<newProfile>\bin\setupCmdLine.bat
  5. Update property user.root in Profiles\<newProfile>\properties\ssl.client.props
  6. Replace all occurences of <oldProfile> with <newProfile> in Profiles\<newProfile>\firststeps\firststeps.bat
  7. Edit AppServer\properties\profileRegistry.xml. Make a copy of the <oldProfile> and update the tag values with the <newProfile>. Should look something like this: <profile isAReservationTicket="false" isDefault="false" name="newProfile" path=".....\Profiles\newProfile" template=".......\AppServer\profileTemplates\default"/>
  8. 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"
  9. Edit config/cells/<cell>/nodes/<node>/variables.xml. Update the USER_INSTALL_ROOT path.
  10. Update the path of WAS_USER_SCRIPT in AppServer\properties\fsdb\<newProfile>.bat

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

Upvotes: 10

svachon
svachon

Reputation: 7716

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

createAppServerTemplate

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

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

Upvotes: 0

Related Questions