The WLST command ConfigToScript converts an existing server configuration (config directory) to an executable WLST python script.The syntax for this command is :
configToScript([configPath], [pyPath], [overwrite], [propertiesFile], [createDeploymentScript])
– configPath : Optional value. This is the path to the config directory that contains the configuration of the domain that you want to convert. The default location is domain/config directory.
– pyPath : Optional value. This is the path and filename to which you want to write the converted WLST script. This argument defaults to domain/config/config.py.
– overwrite : Optional value. This is a 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 value. This is a 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 value. This is a 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. The file named deploy.py will be created.
Here is an example in weblogic server 10.3, where I have created WLST scripts which include a properties file, python script which has configurations of the domain, file to store the passwords used in the domain by the servers.
From the command prompt, start the WLST.cmd file from the path D:BEA103wlserver_10.3commonbin. WLST will start in offline mode.
Execute the command configToScript as below:
Below are the files that will be created in the D:/Files/MyScripts directory: