Monday, December 6, 2010

ConfigToScript command

configToScript

Converts an existing server configuration (config directory) to an executable WLST script. You can use the resulting script to re-create the resources on other servers.


The configToScript command creates the following files:
  • A WLST script that contains the commands needed to recreate the configuration.
  • A properties file that contains domain-specific values. You can update the values in this file to create new domains that are similar to the original configuration.
  • A user configuration file and an associated key file to store encrypted attributes. The user configuration file contains the encrypted information. The key file contains a secret key that is used to encrypt and decrypt the encrypted information.
When you run the generated script:
  • If a server is currently running, WLST will try to connect using the values in the properties file and then run the script commands to create the server resources.
  • If no server is currently running, WLST will start a server with the values in the properties file, run the script commands to create the server resources, and shutdown the server. This may cause WLST to exit from the command shell.
In the event of an error, the command returns a WLSTException.

Syntax

configToScript([configPath], [pyPath], [overwrite], [propertiesFile], [createDeploymentScript])
Argument
Definition 
configPath
Optional. Path to the domain directory that contains the configuration that you want to convert. This argument defaults to the directory from which you start WLST(./).
pyPath
Optional. Path and filename to which you want to write the converted WLST script. This argument defaults to ./config/config.py.
overwrite
Optional. Boolean value specifying whether the script file should be overwritten if it already exists. This argument defaults to true, indicating that the script file is overwritten.
propertiesFile
Optional. Path to the directory in which you want WLST to write the properties files. This argument defaults to the pathname specified for the scriptPath argument.
createDeploymentScript
Optional. Boolean value specifying whether WLST creates a script that performs deployments only. This argument defaults to false, indicating that a deployment script is not created.


Example
wls:/offline> configToScript('/app/bea9/user_projects/domains/base_domain','/app/bea9/scripts','true','/app/bea9/scripts/base_domainconfig.py.properties','true')
configToScript is loading configuration from /app/bea9/user_projects/domains/base_domain/config/config.xml ...
Completed configuration load, now converting resources to wlst script...
Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. Creating new key...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
configToScript completed successfully The WLST script is written to /app/bea9/scripts/config.py and the properties file associated with this script is written to /app/bea9/scripts/config.py.properties
WLST found encrypted passwords in the domain configuration.
These passwords are stored encrypted in /app/bea9/scripts/c2sConfigbase_domain
and /app/bea9/scripts/c2sSecretbase_domain. WLST will use these password values
while the script is run.
wls:/offline> 


Below are the files that will be created in the /app/bea9/scripts directory:
-    c2sConfigbase_domain
-    c2sSecretbase_domain
-    base_domainconfig.py
-    base_domainconfig.py.properties
-    deploy.py

No comments: