Importing and exporting configuration data

SUSE Linux Enterprise Server 15 SP5 LPAR mode z/VM guest KVM guest

Import configuration data from, or export data to, a text file by using the --import and --export options of the chzdev command. You can also use an existing configuration as a template for a new configuration, for example, for a new Linux® instance.

About this task

The export function can be used, for example, to transfer a device configuration to another system, or to store it for later use as a backup or for a rollback.
Read syntax diagramSkip visual syntax diagram chzdev Device or device type selection --export  <filename> | -  --import  <filename> | -  --base  <path> |  <key=value>

where:

--export <filename>|-
writes configuration data to a text file called <filename>. If a single hyphen (-) is specified instead of a file name, data is written to the standard output stream. The output format of this option can be used with the --import option. To reduce the scope of exported configuration data, you can select specific devices, a device type, or define whether to export only data for the active or persistent configuration.
--import <filename>|-
reads configuration data from <filename> and applies it. If a single hyphen (-) is specified instead of a file name, data is read from the standard input stream. The input format must be the same as the format produced by the --export option.

By default, all configuration data that is read is also applied. To reduce the scope of imported configuration data, you can select specific devices, a device type, or define whether to import only data for the active or persistent configuration.

You can use this option to import auto-configuration data, see Displaying auto-configuration data.

--base <path> | <key=value>
changes file system paths that are used to access files. If <path> is specified without an equal sign (=), it is used as base path for accessing files in the active and persistent configuration. If the specified parameter is in <key=value> format, only those paths that begin with <key> are modified. For these paths, the initial <key> portion is replaced with <value>.

Example: lszdev --persistent --base /etc=/mnt/etc

Examples

  • Textual configuration data is either written to a file or, when you specify the special file name "-", to standard output:
    # chzdev --by-interface eth0 --persistent --export -
    Exporting configuration data to standard output
    # Generated by chzdev on linux.example.com
    [persistent qeth 0.0.a000:0.0.a001:0.0.a002]
    layer2=0
    online=1
  • To export this configuration data to a file called config.txt, issue:
    # chzdev --by-interface eth0 --persistent --export config.txt
  • To apply data in this format to a system’s configuration, use the --import option:
    # chzdev --import config.txt
    Importing configuration data from config.txt
    QETH device 0.0.a000:0.0.a001:0.0.a002 configured
  • To create a persistent configuration for an ECKD DASD 0.0.1000 and write it to a new Linux system that is mounted under /mnt/etc, issue:
    # chzdev dasd-eckd 1000 -e -p --base /etc=/mnt/etc
  • To display a configuration that was written to /mnt/etc, issue:
    # lszdev --persistent --base /etc=/mnt/etc
  • To copy the persistent configuration to /mnt/etc, issue:
    # chzdev --all --persistent --export - | chzdev --import - --base /etc=/mnt/etc
    Exporting configuration data to standard output
    Importing configuration data from Standard input
    ECKD DASD 0.0.1234 configured
    FCP device 0.0.190d configured
    FCP device 0.0.194d configured
    CTC device 0.0.c000:0.0.c001 configured
  • To export the site 3-specific configuration data of an ECKD DASD 0.0.f008 to a file config_s3.txt, issue:
    # chzdev dasd-eckd 0.0.f008 --site 3 --export config_s3.txt