Migrating packages from legacy to modular style

7
Migration utility
The cmmigratepkg command automates the migration of a legacy package to a modular package. It creates a package
configuration (ASCII) file for a modular package with the legacy package’s information. The syntax is as follows:
cmmigratepkg -p <package_name> [-x <external_script_name>] [-e] -o <output_file>
The package must be a configured legacy package. It can be on-line or off-line. cmmigratepkg reads the package’s
control script, so the control script must be located on the node where the command is run. cmmigratepkg can migrate
packages created by Serviceguard versions A.11.09 through A.11.18.
The control script’s customer-defined area is any code between “#START CUSTOMER DEFINED FUNCTIONS” and “#END
CUSTOMER DEFINED FUNCTIONS”. If the customer-defined area has code that needs to be migrated, cmmigratepkg can
create an external script by inserting the shell code from the control script into the external_script file. The external
script is generated from the external template found in $SGCONF/examples/external_script.template. (See the
Managing Serviceguard manuals for
HP-UX servers and Linux servers for more information about the template.)
Non-Serviceguard variables defined in the legacy package control script can be converted to PEVs. cmmigratepkg
displays informational messages identifying variables that it cannot convert because they are non-Serviceguard
variables. If these non-Serviceguard variables are defined and used in the customer-defined area, there is no need
to convert them to PEVs. If they are defined in another location in the control script, and the values need to be part
of the package, they can be converted to PEVs using the -e option. These PEVs are defined in the new package
configuration file.
If non-Serviceguard functions are defined in the legacy package control script, cmmigratepkg lists them to STDOUT.
These functions are not converted. You must determine if the functions are called and how you want to migrate them to
the modular package. You can then put them into the new external script file.
Input parameters
-p package_name
The name of an existing legacy package. Used to obtain the current configuration information.
-x external_script_name
The name of the external-script file. cmmigratepkg reads the user-defined functions for start and halt, and creates an
external script from them. The external_script_name is the full pathname of the target file.
-o outputfile
The name of the target file that will contain the configuration for the new modular package.
-e
Create PEVs from parameters found in the package control script. cmmigratepkg adds the prefix “PEV_” to the
parameter name and writes the resulting name to outputfile.