Transfer portal configuration data using the XML configuration interface
When using the XML configuration interface to transfer HCL WebSphere Portal configuration data, you export or import an XML script file. In most cases, we can use the result file from an XML export for an XML import. Sometimes we can use the export result file directly, sometimes we must modify it.
An XML file that you process must always be in UTF-8 encoding. It must specify the root element and schema that is given in the following example code snippet.
<?xml version="1.0" encoding="UTF-8"?> <request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PortalConfig_8.5.0.xsd" type="export|update"> . . . configuration . . . </portal> </request>For an XML export, specify export for the request type. For an XML import, specify a request type of update. The line where we specify either of these request types is highlighted in the example. For more information about the structure of an XML input script file, see the reference topics about the XML input script file structure.
- Run the XML command-line interface with a file that has a request type of export in it. For example, we can use one of the XML sample files with request type export provided with HCL WebSphere Portal. The XML command-line interface returns a result file that contains the resources specified in the XML file usedd for the export. This file can be, for example a resource and all dependent resources. The file that XML command-line interface returns specifies update for the request type and locate or update for the individual resources actions. This file is ready to be used for an XML import.
- Optional: Modify the XML result file from the export as required. For example, to create extra resources, use the actions create or update.
- Run the XML command-line interface, and specify the XML file that resulted from the XML export and that we might have modified in the previous steps. We can also use one of the XML sample files with request type update in it. The XML command-line interface returns a result file that indicates whether the specified resources were imported successfully, or what errors might have occurred.
What to do next
Usage notes:
- Use the XML output result file for further processing:
- When the XML request finishes processing on the server, the resulting XML output is sent back to the client and written to the standard output. We can write the output to an XML file using the -out command-line option. Using this option always writes the output in UTF-8 encoding, so we can usually use that file for further XML processing. If you do not use this option, the output is written in a console encoding that depends on the operating system and active locale. It might therefore be invalid XML. For more information, see the topics about using the XML command-line client.
- Usage notes on the difference between XML exports and imports:
- The command-line syntax and XML processing is the same for both exports and imports. You specify an XML input file to the XML configuration interface, and the XML configuration interface returns a resulting XML export file.
- The difference between export and import is determined by whether we set the request type to export or update in the XML input file specified in the command-line request. When we run an XML import, the resources action attribute can have the following values: locate, create or update. For more information about XML resources, elements, and attributes, see the topics about the XML configuration reference and Types of portal resources.
For more information about XML exports and imports and transfers of portal configuration, see the following topics. For more information about the structure of an XML input script file, see the reference topics about the XML configuration interface.
- Transfer a complete configuration For transferring complete portal configurations, HCL WebSphere Portal provides a Release Builder tool.
- Export and transferring parts of a portal configuration We can also export partial configurations.
References:>
- Use the XML configuration command line client
- XML input script file structure
- XML tags for portal resources
- Sample XML configuration files