8.3. Synchronization via Export

The Red Hat Satellite Exporter (rhn-satellite-exporter) tool exports content listing in an XML format, which a user imports into another Red Hat Satellite. Export the content into a chosen directory with the -d option, transport the directory to another Red Hat Satellite, and use the Satellite Synchronization Tool to import the contents. This synchronizes the two Red Hat Satellites so they contain identical content.
The Red Hat Satellite Exporter provides the following content:
  • Channel Families
  • Architectures
  • Channel metadata
  • Blacklists
  • RPMs
  • RPM metadata
  • Errata
  • Kickstarts
To perform a Red Hat Satellite Exporter export, meet the following prerequisites:
  • A successful Red Hat Satellite installation.
  • Sufficient disk space in the directory specified in the -d option. This directory will contain the exported contents.

8.3.1. Performing an Export

Export the current Red Hat Satellite configuration into a backup or storage solution by executing the following command as root:
# rhn-satellite-exporter -d /var/rhn-sat-export --no-errata --channel [channel_name]
When finished, move the exported directory to another Red Hat Satellite or a storage solution using rsync or scp -r.
The Red Hat Satellite Exporter offers several command line options. To use them, insert the option and appropriate value after the rhn-satellite-exporter command. See the rhn-satellite-exporter manpage for all available options and their meaning.
Select the contents, such as RPMs, errata, or kickstarts, to export using these command line options.
The amount of time it takes rhn-satellite-exporter to export data depends on the number and size of the exported channels. The --no-packages, --no-kickstarts, --no-errata, and --no-rpms options reduce the amount of time required for rhn-satellite-exporter to run, but also prevents export of potentially useful information. For that reason, only use these options when certain the content is not required and can be excluded. Additionally, use the matching options for cdn-sync when importing the data. For example, if you use --no-kickstarts with rhn-satellite-exporter, specify the same --no-kickstarts option when importing the data.
When exporting a Red Hat Network base channel, export the tools channel associated with that base channel. The tools channels contain the auto-kickstart packages, which install packages for kickstarting a machine through the Red Hat Satellite.

8.3.2. Moving Exported Data

The following procedure copies the Red Hat Satellite Exporter data onto the local system for import.

Procedure 8.3. Moving Exporter Content

  1. Log into the machine as root.
  2. Create a target directory for the files, such as:
    # mkdir /var/rhn-sat-import/
    
  3. Make the export data available on the local machine in the directory created in the previous step. Either copy the data directly, or mount the data from another machine using NFS. Copy the data into the new directory with the following command:
    # scp -r root@storage.example.com:/var/rhn-sat-export/* /var/rhn-sat-import
    
Now that the data is available, proceed with performing the import.

8.3.3. Performing an Import

The following process assumes the user has completed Section 8.3.2, “Moving Exported Data” and copied all data to /var/rhn-sat-import.
  1. List the channels available for import with the command:
    # satellite-sync --list-channels --mount-point /var/rhn-sat-import
    
  2. Initiate the import of a specific channel using a channel label presented in the previous list. Run the following command :
    # satellite-sync --channel=[channel-label] --mount-point=/var/rhn-sat-import
    

    Note

    Importing package data can take up to two hours per channel. Register systems to channels as soon as they appear in the Red Hat Satellite web interface. No packages are necessary for registration, although updates cannot be retrieved from the Satellite until the channel is completely populated.
    Repeat this step for each channel or include them all within a single command by passing each channel label preceded by an additional --channel flag:
    # satellite-sync --channel=channel-label-1 -c channel-label-2 --mount-point=/var/rhn-sat-import
    
  3. The population of channels executes until completion. Verify all of the packages are moved out of the repository with the following command:
    # cd /var/rhn-sat-import/; ls -alR | grep rpm
    
    If all RPMs are installed and moved to their permanent locations, the count appears as zero. If so, remove the temporary /var/rhn-sat-import/ repository.
    # rm -rf /var/rhn-sat-import