3.6. Exporting Entities from Satellite 5

Before you can transition your Satellite 5 data to Satellite 6, you need to export the required entities into a specially-formatted file suitable for use by the Satellite 6 import tools.
The expected work flow on the Satellite 5 server is to use the spacewalk-export command as a wrapper. This wrapper command calls the following commands to export Satellite 5 entities:
spacewalk-report channels
Export all custom and cloned channels and repositories for all organizations.
spacewalk-report activation-keys
Export activation keys.
spacewalk-report kickstart-scripts
Exports kickstart scripts for all organizations.
spacewalk-report users
Export organizations and users.
spacewalk-report system-groups
Export all system groups for all organizations.
spacewalk-report config-files-latest
Export information on configuration channels and the latest configuration file versions.
spacewalk-report repositories
Export repositories.
spacewalk-report system-profiles
Export information about the systems managed by Satellite 5.
Running the exports directly on the Satellite 5 server allows complete access to the spacewalk-export functionality, including limiting the data exported, using the --where and --like options. However, if the goal is to export as much as possible - or at most limit by organization - the spacewalk-export tool can manage the process for you.
The spacewalk-export command also uses the spacewalk-export-channels command to collect information and content for non-Red Hat channels.

3.6.1. Exporting Data from Satellite 5

Run the following command to list the entities that you can export:
# spacewalk-export --list-entities

INFO: Currently-supported entities include:
INFO:             channels : Custom/cloned channels and repositories for all organizations
INFO:      activation-keys : Activation keys
INFO:    kickstart-scripts : Kickstart scripts for all organizations
INFO:                users : Users and Organizations
INFO:        system-groups : System-groups for all organizations
INFO:  config-files-latest : Latest revision of all configuration files
INFO:         repositories : Defined repositories
INFO:      system-profiles : System profiles for all organizations
You can use the --entities option to limit the export by entity.
# spacewalk-export --entities users,repositories
You can also use the --entities option with the channels parameter to export all channel data available on the Satellite 5 instance. Using this format calls both spacewalk-report-channels and spacewalk-export-channels, and consequently exports both Red Hat and non-Red Hat channels.
You can use the --org option to limit the export by organization. Use the spacewalk-report users command to retrieve a list of organization IDs.
# spacewalk-export --org=ORG-ID
By default, the spacewalk-export command stores all exports in the ~/spacewalk-export-dir/exports file, and packages all export data into the ~/spacewalk-export-dir/spacewalk_export.tar.gz file. You can use the following options on the command line to specify different values:
# spacewalk-export --export-dir=your-export-directory
# spacewalk-export --export-package=your-export-package-name
The following is an example of a typical export session:

Example 3.1. Example of a Typical Export Session

# spacewalk-export

INFO: Processing channels...

Processing organization: GLOBAL SUPPORT SERVI RED HAT, INC.

* channel: clone-rhel-x86_64-server-5 with: 15778 packages
* channel: clone-rhel-x86_64-server-6 with: 12157 packages
* channel: clone-rhel-x86_64-server-optional-6 with: 6931 packages
.
.
* channel: epel-puppet-rhel6-server-x86_64 with: 8 packages
* channel: puppet-rhel5-server-x86_64 with: 409 packages
* channel: puppet-rhel6-server-x86_64 with: 373 packages

INFO: Processing system-groups...
INFO: Processing activation-keys...
INFO: Processing repositories...
INFO: Processing users...
INFO: Export-file created at /root/spacewalk-export-dir/spacewalk_export.tar.gz

3.6.2. Transferring Exports to Satellite 6

After you have successfully exported all the required entities from your Satellite 5 server, transfer the /root/spacewalk-export-dir/spacewalk_export.tar.gz file to the Satellite 6 server. If the two servers are connected over the network, you can use scp or a similar tool to transfer the file. Alternatively, use removable media such as a USB device or DVD.

Warning

Red Hat strongly recommends that you place the spacewalk_export.tar.gz file in the /tmp/ directory on your Satellite 6 system. This ensures that the extracted files have suitable permissions for the import process.
Extracting the Exported Archive

Extract the spacewalk_exports.tar.gz archive into the /tmp/ directory on your Satellite 6 server. This creates a /tmp/exports/ directory that contains all the exported data, ready to import and recreate within the Satellite 6 server. As part of the import process, use the --directory option with the hammer import commands to specify this directory as the source directory.

Important

Ensure you have sufficient disk space to extract the archive within the /tmp/ directory.
The transition process uses local disk mirrors to import data from the archive into Satellite 6. If the /tmp/ directory cannot be used, ensure that you use an alternative that provides sufficient space and read access for the apache user and group.
Ensure that the apache user and group has read access to the /tmp/exports/ directory. If necessary, adjust the group and permissions:
# chgrp -R apache /tmp/exports/
# chmod -R 0750 /tmp/exports/

Important

If SELinux is enabled, ensure the tmp_t SELinux file context is applied to the /tmp/exports/ directory. If necessary, apply the label manually:
# chcon -R system_u:object_r:tmp_t:s0 /tmp/exports/
If the SELinux context is not set correctly, Satellite cannot synchronize the content.