Search

Chapter 9. Synchronizing Content Between Satellite Servers

download PDF

In a Satellite setup with multiple Satellite Servers, you can use Inter-Satellite Synchronization (ISS) to synchronize content from one upstream server to one or more downstream servers.

There are two possible ISS configurations of Satellite, depending on how you deployed your infrastructure. Configure your Satellite for ISS as appropriate for your use case scenario. For more information, see How to Configure Inter-Satellite Synchronization in Installing Satellite Server in a Disconnected Network Environment. To change the pulp export path, see the Knowledgebase article Hammer content export fails with "Path '/the/path' is not an allowed export path" on the Red Hat Customer Portal.

9.1. How to Synchronize Content Using Export and Import

There are multiple approaches for synchronizing content using the export and import workflow:

  • You employ the upstream Satellite Server as a content store, which means that you sync the whole Library rather than Content View versions. This approach offers the simplest export/import workflow. In such case, you can manage the versions downstream. For more information, see Section 9.1.1, “Using an Upstream Satellite Server as a Content Store”.
  • You use the upstream Satellite Server to sync Content View versions. This approach offers more control over what content is synced between Satellite Servers. For more information, see Section 9.1.2, “Using an Upstream Satellite Server to Sync Content View Versions”.
  • You sync a single repository. This can be useful if you use the Content-View syncing approach, but you want to sync an additional repository without adding it to an existing Content View. For more information, see Section 9.1.3, “Synchronizing a Single Repository”.

    Note

    Synchronizing content using export and import requires the same major, minor, and patch version of Satellite on both the downstream and upstream Satellite Servers.

    When you are unable to match upstream and downstream Satellite versions, you can use:

    • Syncable exports and imports.
    • Inter-Satellite Synchronization (ISS) with your upstream Satellite connected to the Internet and your downstream Satellite connected to the upstream Satellite.

9.1.1. Using an Upstream Satellite Server as a Content Store

In this scenario, you use the upstream Satellite Server as a content store for updates rather than to manage content. You use the downstream Satellite Server to manage content for all infrastructure behind the isolated network. You export the Library content from the upstream Satellite Server and import it into the downstream Satellite Server.

On the upstream Satellite Server

  1. Ensure that repositories are using the Immediate download policy in one of the following ways:

    1. For existing repositories using On Demand, change their download policy on the repository details page to Immediate.
    2. For new repositories, ensure that the Default Red Hat Repository download policy setting is set to Immediate before enabling Red Hat repositories, and that the Default download policy is set to Immediate for custom repositories.

    For more information, see Section 5.8, “Download Policies Overview”.

  2. Enable the content that you want to synchronize. For more information, see Section 5.5, “Enabling Red Hat Repositories”.

    If you want to sync custom content, first create a custom Product and synchronize Product repositories.

  3. Synchronize the enabled content:

    1. On the first export, perform a complete Library export so that all the synchronized content is exported. This generates content archives that you can later import into one or more downstream Satellite Servers. For more information on performing a complete Library export, see Section 9.3, “Exporting the Library Environment”.
    2. Export all future updates on the upstream Satellite Server incrementally. This generates leaner content archives that contain only a recent set of updates. For example, if you enable and synchronize a new repository, the next exported content archive contains content only from the newly enabled repository. For more information on performing an incremental Library export, see Section 9.6, “Exporting the Library Environment Incrementally”.

On the downstream Satellite Server

  1. Bring the content exported from the upstream Satellite Server over to the hard disk.
  2. Place it inside a directory under /var/lib/pulp/imports.
  3. Import the content to an organization using the procedure outlined in Section 9.17, “Importing into the Library Environment”.

    You can then manage content using Content Views or Lifecycle Environments as you require.

9.1.2. Using an Upstream Satellite Server to Sync Content View Versions

In this scenario, you use the upstream Satellite Server not only as a content store, but also to synchronize content for all infrastructure behind the isolated network. You curate updates coming from the CDN into Content Views and Lifecycle Environments. Once you promote content to a designated Lifecycle Environment, you can export the content from the upstream Satellite Server and import it into the downstream Satellite Server.

On the upstream Satellite Server

  1. Ensure that repositories are using the Immediate download policy in one of the following ways:

    1. For existing repositories using On Demand, change their download policy on the repository details page to Immediate.
    2. For new repositories, ensure that the Default Red Hat Repository download policy setting is set to Immediate before enabling Red Hat repositories, and that the Default download policy is set to Immediate for custom repositories.

    For more information, see Section 5.8, “Download Policies Overview”.

  2. Enable the content that you want to synchronize. For more information, see Section 5.5, “Enabling Red Hat Repositories”.

    If you want to sync custom content, first create a custom Product and synchronize Product repositories.

  3. Synchronize the enabled content:

    1. For the first export, perform a complete Version export on the Content View Version that you want to export. For more information see, Section 9.8, “Exporting a Content View Version”. This generates content archives that you can import into one or more downstream Satellite Servers.
    2. Export all future updates in the connected Satellite Servers incrementally. This generates leaner content archives that contain changes only from the recent set of updates. For example, if your Content View has a new repository, this exported content archive contains only the latest changes. For more information, see Section 9.10, “Exporting a Content View Version Incrementally”.
    3. When you have new content, republish the Content Views that include this content before exporting the increment. For more information, see Chapter 8, Managing Content Views. This creates a new Content View Version with the appropriate content to export.

On the downstream Satellite Server

  1. Bring the content exported from the upstream Satellite Server over to the hard disk.
  2. Place it inside a directory under /var/lib/pulp/imports.
  3. Import the content to the organization that you want. For more information, see Section 9.19, “Importing a Content View Version”. This will create a Content View Version from the exported content archives and then import content appropriately.

9.1.3. Synchronizing a Single Repository

In this scenario, you export and import a single repository.

On the upstream Satellite Server

  1. Ensure that the repository is using the Immediate download policy in one of the following ways:

    1. For existing repositories using On Demand, change their download policy on the repository details page to Immediate.
    2. For new repositories, ensure that the Default Red Hat Repository download policy setting is set to Immediate before enabling Red Hat repositories, and that the Default download policy is set to Immediate for custom repositories.

    For more information, see Section 5.8, “Download Policies Overview”.

  2. Enable the content that you want to synchronize. For more information, see Section 5.5, “Enabling Red Hat Repositories”.

    If you want to sync custom content, first create a custom Product and synchronize Product repositories.

  3. Synchronize the enabled content:

    1. On the first export, perform a complete repository export so that all the synchronized content is exported. This generates content archives that you can later import into one or more downstream Satellite Servers. For more information on performing a complete repository export, see Section 9.12, “Exporting a Repository”.
    2. Export all future updates on the upstream Satellite Server incrementally. This generates leaner content archives that contain only a recent set of updates. For more information on performing an incremental repository export, see Section 9.14, “Exporting a Repository Incrementally”.

On the downstream Satellite Server

  1. Bring the content exported from the upstream Satellite Server over to the hard disk.
  2. Place it inside a directory under /var/lib/pulp/imports.
  3. Import the content to an organization. See Section 9.21, “Importing a Repository”.

    You can then manage content using Content Views or Lifecycle Environments as you require.

9.2. Synchronizing a Custom Repository

When using Inter-Satellite Synchronization Network Sync, Red Hat repositories are configured automatically, but custom repositories are not. Use this procedure to synchronize content from a custom repository on a connected Satellite Server to a disconnected Satellite Server through Inter-Satellite Synchronization (ISS) Network Sync.

Follow the procedure for the connected Satellite Server before completing the procedure for the disconnected Satellite Server.

Connected Satellite Server

  1. In the Satellite web UI, navigate to Content > Products.
  2. Click on the custom product.
  3. Click on the custom repository.
  4. Copy the Published At: URL.
  5. Continue with the procedure on disconnected Satellite Server.

Disconnected Satellite Server

  1. Download the katello-server-ca.crt file from the connected Satellite Server:

    # curl http://satellite.example.com/pub/katello-server-ca.crt
  2. Create an SSL Content Credential with the contents of katello-server-ca.crt. For more information on creating an SSL Content Credential, see Section 5.2, “Importing Custom SSL Certificates”.
  3. In the Satellite web UI, navigate to Content > Products.
  4. Create your custom product with the following:

    • Upstream URL: Paste the link that you copied earlier.
    • SSL CA Cert: Select the SSL certificate that was transferred from your connected Satellite Server.

    For more information on creating a custom product, see Section 5.3, “Creating a Custom Product”.

After completing these steps, the custom repository is properly configured on the disconnected Satellite Server.

9.3. Exporting the Library Environment

You can export contents of all Yum repositories in the Library environment of an organization to an archive file from Satellite Server and use this archive file to create the same repositories in another Satellite Server or in another Satellite Server organization. The exported archive file contains the following data:

  • A JSON file containing Content View version metadata.
  • An archive file containing all the repositories from the Library environment of the organization.

Satellite Server exports only RPM, kickstart files, and Docker Content included in the Library environment.

Prerequisites

To export the contents of the Library lifecycle environment of the organization, ensure that Satellite Server where you want to export meets the following conditions:

  • Ensure that the export directory has free storage space to accommodate the export.
  • Ensure that the /var/lib/pulp/exports directory has free storage space equivalent to the size of the repositories being exported for temporary files created during the export process.
  • Ensure that you set download policy to Immediate for all repositories within the Library lifecycle environment you export. For more information, see Section 5.8, “Download Policies Overview”.
  • Ensure that you synchronize Products that you export to the required date.

Export the Library Content of an Organization

  1. Use the organization name or ID to export.

    # hammer content-export complete library --organization="My_Organization"
  2. Verify that the archive containing the exported version of a Content View is located in the export directory:

    # ls -lh /var/lib/pulp/exports/My_Organization/Export-Library/1.0/2021-03-02T03-35-24-00-00
    total 68M
    -rw-r--r--. 1 pulp pulp 68M Mar  2 03:35 export-1e25417c-6d09-49d4-b9a5-23df4db3d52a-20210302_0335.tar.gz
    -rw-r--r--. 1 pulp pulp 333 Mar  2 03:35 export-1e25417c-6d09-49d4-b9a5-23df4db3d52a-20210302_0335-toc.json
    -rw-r--r--. 1 pulp pulp 443 Mar  2 03:35 metadata.json

    You need all three files, the tar.gz, the toc.json, and the metadata.json file to be able to import.

  3. A new Content View Export-Library is created in the organization. This Content View contains all the repositories belonging to this organization. A new version of this Content View is published and exported automatically.

Export with chunking

In many cases the exported archive content may be several gigabytes in size. If you want to split it into smaller sizes or chunks. You can use the --chunk-size-gb flag directly in the export command to handle this. In the following example, you can see how to specify --chunk-size-gb=2 to split the archives in 2 GB chunks.

# hammer content-export complete library \
--chunk-size-gb=2 \
--organization="My_Organization"

Generated /var/lib/pulp/exports/My_Organization/Export-Library/2.0/2021-03-02T04-01-25-00-00/metadata.json

# ls -lh /var/lib/pulp/exports/My_Organization/Export-Library/2.0/2021-03-02T04-01-25-00-00/

9.4. Exporting the Library Environment in a Syncable Format

You can export contents of all yum repositories, Kickstart repositories and file repositories in the Library environment of an organization to a syncable format that you can use to create your custom CDN and synchronize the content from the custom CDN over HTTP/HTTPS.

You can then serve the generated content on a local web server and synchronize it on the importing Satellite Server or in another Satellite Server organization.

You can use the generated content to create the same repository in another Satellite Server or in another Satellite Server organization by using content import. On import of the exported archive, a regular content view is created or updated on your importing Satellite Server. For more information, see Section 9.19, “Importing a Content View Version”.

You can export the following content in the syncable format from Satellite Server:

  • Yum repositories
  • Kickstart repositories
  • File repositories

You cannot export Ansible, Deb, or Docker content.

The export contains directories with the packages, listing files, and metadata of the repository in Yum format that can be used to synchronize in the importing Satellite Server.

Prerequisites

  • Ensure that you set the download policy to Immediate for all repositories within the Library lifecycle environment you export. For more information, see Section 5.8, “Download Policies Overview”.
  • Ensure that you synchronize products you export to the required date.
  • Ensure that the user exporting the content has the Content Exporter role.

Procedure

  1. Use the organization name or ID to export:

    # hammer content-export complete library \
    --organization="My_Organization" \
    --format=syncable
  2. Optional: Verify that the exported content is located in the export directory:

    # du -sh /var/lib/pulp/exports/My_Organization/Export-My_Repository/1.0/2021-03-02T03-35-24-00-00

9.5. Importing Syncable Exports

Procedure

  • Use the organization name or ID to import syncable exports:

    # hammer content-import library
    --organization="My_Organization"
    --path="My_Path_To_Syncable_Export"
Note

Syncable exports must be located in one of your ALLOWED_IMPORT_PATHS as specified in /etc/pulp/settings.py. By default, this includes /var/lib/pulp/imports.

9.6. Exporting the Library Environment Incrementally

Exporting Library content can be a very expensive operation in terms of system resources. Organizations that have multiple Red Hat Enterprise Linux trees can occupy several gigabytes of space on Satellite Server.

In such cases, you can use Incremental Export to export only pieces of content that changed since the previous export. Incremental exports typically result in smaller archive files than the full exports.

The example below shows incremental export of all repositories in the organization’s Library.

Procedure

  1. Create an incremental export:

    # hammer content-export incremental library --organization="My_Organization"
    
    Generated /var/lib/pulp/exports/My_Organization/Export-Library/3.0/2021-03-02T04-22-14-00-00/metadata.json
  2. Optional: View the exported data:

    # ls -lh /var/lib/pulp/exports/My_Organization/Export-Library/3.0/2021-03-02T04-22-14-00-00/
    total 172K
    -rw-r--r--. 1 pulp pulp 161K Mar  2 04:22 export-436882d8-de5a-48e9-a30a-17169318f908-20210302_0422.tar.gz
    -rw-r--r--. 1 pulp pulp  333 Mar  2 04:22 export-436882d8-de5a-48e9-a30a-17169318f908-20210302_0422-toc.json
    -rw-r--r--. 1 pulp pulp  492 Mar  2 04:22 metadata.json

9.7. Exporting the Library Environment Incrementally in a Syncable Format

Exporting Library content can be a very costly operation in terms of system resources. Organizations that have multiple Red Hat Enterprise Linux trees can occupy several gigabytes of space on Satellite Server.

In such cases, you can use Incremental Export to export only pieces of content that changed since the previous export. Incremental exports typically result in smaller archive files than full exports.

The procedure below shows incremental export of all repositories in the organization’s Library.

Procedure

  1. Create an incremental export:

    # hammer content-export incremental library \
    --format=syncable \
    --organization="My_Organization"
  2. Optional: View the exported data:

    # find /var/lib/pulp/exports/Default_Organization/Export-Library-SYNCABLE/2.0/2023-03-09T10-55-48-05-00/ -name "*.rpm"

9.8. Exporting a Content View Version

You can export a version of a Content View to an archive file from Satellite Server and use this archive file to create the same Content View version on another Satellite Server or on another Satellite Server organization. Satellite exports composite Content Views as normal Content Views. The composite nature is not retained. On importing the exported archive, a regular Content View is created or updated on your downstream Satellite Server. The exported archive file contains the following data:

  • A JSON file containing Content View version metadata
  • An archive file containing all the repositories included into the Content View version

Satellite Server exports only RPM, kickstart files, and Docker content added to a version of a Content View. Satellite does not export the following content:

  • Content View definitions and metadata, such as package filters.

Prerequisites

To export a Content View, ensure that Satellite Server where you want to export meets the following conditions:

  • Ensure that the export directory has free storage space to accommodate the export.
  • Ensure that the /var/lib/pulp/exports directory has free storage space equivalent to the size of the repositories being exported for temporary files created during the export process.
  • Ensure that you set download policy to Immediate for all repositories within the Content View you export. For more information, see Section 5.8, “Download Policies Overview”.
  • Ensure that you synchronize Products that you export to the required date.
  • Ensure that the user exporting the content has the Content Exporter role.

To Export a Content View Version

  1. List versions of the Content View that are available for export:

    # hammer content-view version list \
    --content-view="My_Content_View" \
    --organization="My_Organization"
    
    ---|----------|---------|-------------|-----------------------
    ID | NAME     | VERSION | DESCRIPTION | LIFECYCLE ENVIRONMENTS
    ---|----------|---------|-------------|-----------------------
    5  | view 3.0 | 3.0     |             | Library
    4  | view 2.0 | 2.0     |             |
    3  | view 1.0 | 1.0     |             |
    ---|----------|---------|-------------|----------------------

Export a Content View version

  1. Get the version number of desired version. The following example targets version 1.0 for export.

    # hammer content-export complete version \
    --content-view="Content_View_Name" \
    --version=1.0 \
    --organization="My_Organization"
  2. Verify that the archive containing the exported version of a Content View is located in the export directory:

    # ls -lh /var/lib/pulp/exports/My_Organization/Content_View_Name/1.0/2021-02-25T18-59-26-00-00/

You require all three files, for example, the tar.gz archive file, the toc.json and metadata.json to import the content successfully.

Export with chunking

In many cases, the exported archive content can be several gigabytes in size. You might want to split it smaller sizes or chunks. You can use the --chunk-size-gb option with in the hammer content-export command to handle this. The following example uses the --chunk-size-gb=2 to split the archives into 2 GB chunks.

# hammer content-export complete version \
--chunk-size-gb=2 \
--content-view="Content_View_Name" \
--organization="My_Organization" \
--version=1.0
# ls -lh /var/lib/pulp/exports/My_Organization/view/1.0/2021-02-25T21-15-22-00-00/

9.9. Exporting a Content View Version in a Syncable Format

You can export a version of a Content View to a syncable format that you can use to create your custom CDN. After you have exported the Content View, you can do either of the following:

  • Synchronize the content from your custom CDN over HTTP/HTTPS.
  • Import the content using hammer content-import. Note that this requires both the Export and Import servers to run Satellite 6.14.

You can then serve the generated content using a local web server on the importing Satellite Server or in another Satellite Server organization.

You cannot directly import Syncable Format exports. Instead, on the importing Satellite Server you must:

  • Copy the generated content to an HTTP/HTTPS web server that is accessible to importing Satellite Server.
  • Update your CDN configuration to Custom CDN.
  • Set the CDN URL to point to the web server.
  • Optional: Set an SSL/TLS CA Credential if the web server requires it.
  • Enable the repository.
  • Synchronize the repository.

You can export the following content in a syncable format from Satellite Server:

  • Yum repositories
  • Kickstart repositories
  • File repositories

You cannot export Ansible, DEB, and Docker content.

The export contains directories with the packages, listing files, and metadata of the repository in Yum format that can be used to synchronize in the importing Satellite Server.

Prerequisites

  • Ensure that you set the download policy to Immediate for all repositories within the Content View you export. For more information, see Section 5.8, “Download Policies Overview”.
  • Ensure that you synchronize products you export to the required date.
  • Ensure that the user exporting the content has the Content Exporter role.

To Export a Content View Version

  • List versions of the Content View that are available for export:

    # hammer content-view version list \
    --content-view="My_Content_View" \
    --organization="My_Organization"

Procedure

  1. Get the version number of desired version. The following example targets version 1.0 for export:

    # hammer content-export complete version \
    --content-view="Content_View_Name" \
    --version=1.0 \
    --organization="My_Organization" \
    --format=syncable
  2. Optional: Verify that the exported content is located in the export directory:

    # ls -lh /var/lib/pulp/exports/My_Organization/My_Content_View_Name/1.0/2021-02-25T18-59-26-00-00/

9.10. Exporting a Content View Version Incrementally

Exporting complete versions can be a very expensive operation in terms of system resources. Content View versions that have multiple Red Hat Enterprise Linux trees can occupy several gigabytes of space on Satellite Server.

In such cases, you can create an incremental export which contains only pieces of content that changed since the previous export. Incremental exports typically result in smaller archive files than the full exports.

The example below targets the version 2.0 for export because the version 1.0 was exported previously.

Procedure

  1. Create an incremental export:

    # hammer content-export incremental version \
    --content-view="Content_View_Name" \
    --organization="My_Organization" \
    --version=2.0 \
    --format=syncable
  2. Optional: View the exported Content View:

    # ls -lh /var/lib/pulp/exports/My_Organization/view/2.0/2021-02-25T21-45-34-00-00/

9.11. Exporting a Content View Version Incrementally in a Syncable Format

Exporting complete Content View versions can be a very costly operation in terms of system resources. Content View versions that have multiple Red Hat Enterprise Linux trees can occupy several gigabytes of space on Satellite Server.

In such cases, you can use Incremental Export to export only pieces of content that changed since the previous export. Incremental exports typically result in smaller archive files than the full exports.

The example below targets the version 2.0 for export because the version 1.0 was exported previously.

Procedure

  1. Create an incremental export:

    # hammer content-export incremental version \
    --content-view="My_Content_View_Name" \
    --organization="My_Organization" \
    --version=2.0 \
    --format=syncable
  2. Optional: View the exported Content View:

    # find /var/lib/pulp/exports/Default_Organization/view/2.0/2023-03-02T14-19-50-05-00/ -name "*.rpm"

9.12. Exporting a Repository

You can export the content of a repository in the Library environment of an organization from Satellite Server. You can use this archive file to create the same repository in another Satellite Server or in another Satellite Server organization.

You can export the following content from Satellite Server:

  • Ansible repositories
  • Kickstart repositories
  • Yum repositories
  • File repositories
  • Docker content

The export contains the following data:

  • Two JSON files containing repository metadata.
  • One or more archive files containing the contents of the repository from the Library environment of the organization.

You need all the files, tar.gz, toc.json and metadata.json, to be able to import.

Prerequisites

  • Ensure that the export directory has enough free storage space to accommodate the export.
  • Ensure that the /var/lib/pulp/exports directory has enough free storage space equivalent to the size of all repositories that you want to export.
  • Ensure that you set download policy to Immediate for the repository within the Library lifecycle environment you export. For more information, see Section 5.8, “Download Policies Overview”.
  • Ensure that you synchronize products that you export to the required date.

Procedure

  1. Export a repository:

    # hammer content-export complete repository \
    --name="My_Repository" \
    --product="My_Product" \
    --organization="My_Organization"
    Note

    The size of the exported archive depends on the number and size of the packages within the repository. If you want to split the exported archive into chunks, export your repository using the --chunk-size-gb argument to limit the size by an integer value in gigabytes, for example ---chunk-size-gb=2.

  2. Optional: Verify that the exported archive is located in the export directory:

    # ls -lh /var/lib/pulp/exports/My_Organization/Export-My_Repository/1.0/2022-09-02T03-35-24-00-00/

9.13. Exporting a Repository in a Syncable Format

You can export the content of a repository in the Library environment of an organization to a syncable format that you can use to create your custom CDN and synchronize the content from the custom CDN over HTTP/HTTPS.

You can then serve the generated content using a local web server on the importing Satellite Server or in another Satellite Server organization.

You cannot directly import Syncable Format exports. Instead, on the importing Satellite Server you must:

  • Copy the generated content to an HTTP/HTTPS web server that is accessible to importing Satellite Server.
  • Update your CDN configuration to Custom CDN.
  • Set the CDN URL to point to the web server.
  • Optional: Set an SSL/TLS CA Credential if the web server requires it.
  • Enable the repository.
  • Synchronize the repository.

You can export the following content in a syncable format from Satellite Server:

  • Yum repositories
  • Kickstart repositories
  • File repositories

You cannot export Ansible, DEB, and Docker content.

The export contains directories with the packages, listing files, and metadata of the repository in Yum format that can be used to synchronize in the importing Satellite Server.

Prerequisite

Procedure

  1. Export a repository using the repository name or ID:

    # hammer content-export complete repository \
    --organization="My_Organization" \
    --product="My_Product" \
    --name="My_Repository" \
    --format=syncable
  2. Optional: Verify that the exported content is located in the export directory:

    # du -sh /var/lib/pulp/exports/My_Organization/Export-My_Repository/1.0/2021-03-02T03-35-24-00-00

9.14. Exporting a Repository Incrementally

Exporting a repository can be a very expensive operation in terms of system resources. A typical Red Hat Enterprise Linux tree may occupy several gigabytes of space on Satellite Server.

In such cases, you can use Incremental Export to export only pieces of content that changed since the previous export. Incremental exports typically result in smaller archive files than the full exports.

The example below shows incremental export of a repository in the Library lifecycle environment.

Procedure

  1. Create an incremental export:

    # hammer content-export incremental repository \
    --name="My_Repository" \
    --organization="My_Organization" \
    --product="My_Product"
  2. Optional: View the exported data:

    # ls -lh /var/lib/pulp/exports/My_Organization/Export-My_Repository/3.0/2021-03-02T03-35-24-00-00/
    total 172K
    -rw-r--r--. 1 pulp pulp  20M Mar  2 04:22 export-436882d8-de5a-48e9-a30a-17169318f908-20210302_0422.tar.gz
    -rw-r--r--. 1 pulp pulp  333 Mar  2 04:22 export-436882d8-de5a-48e9-a30a-17169318f908-20210302_0422-toc.json
    -rw-r--r--. 1 root root  492 Mar  2 04:22 metadata.json

9.15. Exporting a Repository Incrementally in a Syncable Format

Exporting a repository can be a very costly operation in terms of system resources. A typical Red Hat Enterprise Linux tree may occupy several gigabytes of space on Satellite Server.

In such cases, you can use Incremental Export to export only pieces of content that changed since the previous export. Incremental exports typically result in smaller archive files than full exports.

The procedure below shows an incremental export of a repository in the Library lifecycle environment.

Procedure

  1. Create an incremental export:

    # hammer content-export incremental repository \
    --format=syncable \
    --name="My_Repository" \
    --organization="My_Organization" \
    --product="My_Product"
  2. Optional: View the exported data:

    # find /var/lib/pulp/exports/Default_Organization/My_Product/2.0/2023-03-09T10-55-48-05-00/ -name "*.rpm"

9.16. Keeping Track of Your Exports

Satellite keeps records of all exports. Each time you export content on the upstream Satellite Server, the export is recorded and maintained for future querying. You can use the records to organize and manage your exports, which is useful especially when exporting incrementally.

When exporting content from the upstream Satellite Server for several downstream Satellite Servers, you can also keep track of content exported for specific servers. This helps you track which content was exported and to where.

Use the --destination-server argument during export to indicate the target server. This option is available for all content-export operations.

Tracking Destinations of Library Exports

  • Specify the destination server when exporting the Library:

    # hammer content-export complete library \
    --destination-server=My_Downstream_Server_1 \
    --organization="My_Organization" \
    --version=1.0

Tracking Destinations of Content View Exports

  • Specify the destination server when exporting a Content View version:

    # hammer content-export complete version \
    --content-view="Content_View_Name" \
    --destination-server=My_Downstream_Server_1 \
    --organization="My_Organization" \
    --version=1.0

Querying Export Records

  • List content exports using the following command:

    # hammer content-export list --organization="My_Organization"

9.17. Importing into the Library Environment

You can import exported Library content into the Library lifecycle environment of an organization on another Satellite Server. For more information about exporting contents from the Library environment, see Section 9.3, “Exporting the Library Environment”.

Prerequisites

  • The exported files must be in a directory under /var/lib/pulp/imports.
  • If there are any Red Hat repositories in the exported content, the importing organization’s manifest must contain subscriptions for the products contained within the export.
  • The user importing the content must have the Content Importer Role.

Procedure

  1. Copy the exported files to a subdirectory of /var/lib/pulp/imports on Satellite Server where you want to import.
  2. Set the ownership of the import directory and its contents to pulp:pulp.

    # chown -R pulp:pulp /var/lib/pulp/imports/2021-03-02T03-35-24-00-00
  3. Verify that the ownership is set correctly:
# ls -lh /var/lib/pulp/imports/2021-03-02T03-35-24-00-00
total 68M
-rw-r--r--. 1 pulp pulp 68M Mar  2 04:29 export-1e25417c-6d09-49d4-b9a5-23df4db3d52a-20210302_0335.tar.gz
-rw-r--r--. 1 pulp pulp 333 Mar  2 04:29 export-1e25417c-6d09-49d4-b9a5-23df4db3d52a-20210302_0335-toc.json
-rw-r--r--. 1 pulp pulp 443 Mar  2 04:29 metadata.json
  1. Identify the Organization that you wish to import into.
  2. To import the Library content to Satellite Server, enter the following command:

    # hammer content-import library \
    --organization="My_Organization" \
    --path=/var/lib/pulp/imports/2021-03-02T03-35-24-00-00

    Note you must enter the full path /var/lib/pulp/imports/My_Exported_Library_Dir. Relative paths do not work.

  3. To verify that you imported the Library content, check the contents of the Product and Repositories. A new Content View called Import-Library is created in the target organization. This Content View is used to facilitate the Library content import.

    By default, this Content View is not shown in the Satellite web UI. Import-Library is not meant to be assigned directly to hosts. Instead, assign your hosts to Default Organization View or another Content View as you would normally.

9.18. Importing into the Library Environment from a web server

You can import exported Library content directly from a web server into the Library lifecycle environment of an organization on another Satellite Server. For more information about exporting contents from the Library environment, see Section 9.3, “Exporting the Library Environment”.

Prerequisites

  • The exported files must be in a syncable format.
  • The exported files must be accessible through HTTP/HTTPS.
  • If there are any Red Hat repositories in the exported content, the importing organization’s manifest must contain subscriptions for the products contained within the export.
  • The user importing the Content View version must have the Content Importer role.

Procedure

  1. Identify the Organization that you wish to import into.
  2. To import the Library content to Satellite Server, enter the following command:

    # hammer content-import library \
    --organization="My_Organization" \
    --path=http://server.example.com/pub/exports/2021-02-25T21-15-22-00-00/

    A new Content View called Import-Library is created in the target organization. This Content View is used to facilitate the Library content import.

    By default, this Content View is not shown in the Satellite web UI. Import-Library is not meant to be assigned directly to hosts. Instead, assign your hosts to Default Organization View or another Content View.

9.19. Importing a Content View Version

You can import an exported Content View version to create a version with the same content in an organization on another Satellite Server. For more information about exporting a Content View version, see Section 9.8, “Exporting a Content View Version”.

When you import a Content View version, it has the same major and minor version numbers and contains the same repositories with the same packages and errata. Custom Repositories, Products and Content Views are automatically created if they do not exist in the importing organization.

Prerequisites

  • The exported files must be in a directory under /var/lib/pulp/imports.
  • If there are any Red Hat repositories in the exported content, the importing organization’s manifest must contain subscriptions for the products contained within the export.
  • The user importing the Content View version must have the Content Importer Role.

Procedure

  1. Copy the exported files to a subdirectory of /var/lib/pulp/imports on Satellite Server where you want to import.
  2. Set the ownership of the import directory and its contents to pulp:pulp.

    # chown -R pulp:pulp /var/lib/pulp/imports/2021-02-25T21-15-22-00-00/
  3. Verify that the ownership is set correctly:

    # ls -lh /var/lib/pulp/imports/2021-02-25T21-15-22-00-00/
  4. To import the Content View version to Satellite Server, enter the following command:

    # hammer content-import version \
    --organization=My_Organization \
    --path=/var/lib/pulp/imports/2021-02-25T21-15-22-00-00/

    Note that you must enter the full path /var/lib/pulp/imports/My_Exported_Version_Dir. Relative paths do not work.

  5. To verify that you imported the Content View version successfully, list Content View versions for your organization:

    # hammer content-view version list \
    --organization-id=My_Organization_ID

9.20. Importing a Content View Version from a web server

You can import an exported Content View version directly from a web server to create a version with the same content in an organization on another Satellite Server. For more information about exporting a Content View version, see Section 9.8, “Exporting a Content View Version”.

When you import a Content View version, it has the same major and minor version numbers and contains the same repositories with the same packages and errata. Custom repositories, products, and Content Views are automatically created if they do not exist in the importing organization.

Prerequisites

  • The exported files must be in a syncable format.
  • The exported files must be accessible through HTTP/HTTPS.
  • If there are any Red Hat repositories in the exported content, the importing organization’s manifest must contain subscriptions for the products contained within the export.
  • The user importing the Content View version must have the Content Importer role.

Procedure

  • Import the Content View version into Satellite Server:

    # hammer content-import version \
    --organization=My_Organization \
    --path=http://server.example.com/pub/exports/2021-02-25T21-15-22-00-00/

9.21. Importing a Repository

You can import an exported repository into an organization on another Satellite Server. For more information about exporting content of a repository, see Section 9.12, “Exporting a Repository”.

Prerequisites

  • The export files must be in a directory under /var/lib/pulp/imports.
  • If the export contains any Red Hat repositories, the manifest of the importing organization must contain subscriptions for the products contained within the export.
  • The user importing the content must have the Content Importer Role.

Procedure

  1. Copy the exported files to a subdirectory of /var/lib/pulp/imports on Satellite Server where you want to import.
  2. Set the ownership of the import directory and its contents to pulp:pulp.

    # chown -R pulp:pulp /var/lib/pulp/imports/2021-03-02T03-35-24-00-00
  3. Verify that the ownership is set correctly:
# ls -lh /var/lib/pulp/imports/2021-03-02T03-35-24-00-00
total 68M
-rw-r--r--. 1 pulp pulp 68M Mar  2 04:29 export-1e25417c-6d09-49d4-b9a5-23df4db3d52a-20210302_0335.tar.gz
-rw-r--r--. 1 pulp pulp 333 Mar  2 04:29 export-1e25417c-6d09-49d4-b9a5-23df4db3d52a-20210302_0335-toc.json
-rw-r--r--. 1 pulp pulp 443 Mar  2 04:29 metadata.json
  1. Identify the Organization that you wish to import into.
  2. To import the repository content to Satellite Server, enter the following command:

    # hammer content-import repository \
    --organization="My_Organization" \
    --path=/var/lib/pulp/imports/2021-03-02T03-35-24-00-00

    Note that you must enter the full path /var/lib/pulp/imports/My_Exported_Repo_Dir. Relative paths do not work.

  3. To verify that you imported the repository, check the contents of the Product and Repository.

9.22. Importing a Repository from a web server

You can import an exported repository directly from a web server into an organization on another Satellite Server. For more information about exporting the content of a repository, see Section 9.12, “Exporting a Repository”.

Prerequisites

  • The exported files must be in a syncable format.
  • The exported files must be accessible through HTTP/HTTPS.
  • If the export contains any Red Hat repositories, the manifest of the importing organization must contain subscriptions for the products contained within the export.
  • The user importing the Content View version must have the Content Importer Role.

Procedure

  1. Select the organization into which you want to import.
  2. To import the repository to Satellite Server, enter the following command:

    # hammer content-import repository \
    --organization="My_Organization" \
    --path=http://server.example.com/pub/exports/2021-02-25T21-15-22-00-00/_

9.23. Exporting and Importing Content using Hammer CLI Cheat Sheet

Table 9.1. Export
IntentCommand

Fully export an Organization’s Library

hammer content-export complete library --organization="My_Organization"

Incrementally export an Organization’s Library (assuming you have exported something previously)

hammer content-export incremental library --organization="My_Organization"

Fully export a Content View version

hammer content-export complete version --content-view="My_Content_View" --version=1.0 --organization="My_Organization"

Export a Content View version promoted to the Dev Environment

hammer content-export complete version --content-view="My_Content_View" --organization="My_Organization" --lifecycle-environment="Dev"

Export a Content View in smaller chunks (2-GB slabs)

hammer content-export complete version --content-view="My_Content_View" --version=1.0 --organization="My_Organization" --chunk-size-gb=2

Incrementally export a Content View version (assuming you have exported something previously)

hammer content-export incremental version --content-view="My_Content_View" --version=2.0 --organization="My_Organization"

Fully export a Repository

hammer content-export complete repository --product="My_Product" --name="My_Repository" --organization="My_Organization"

Incrementally export a Repository (assuming you have exported something previously)

hammer content-export incremental repository --product="My_Product" --name="My_Repository" --organization="My_Organization"

List exports

hammer content-export list --content-view="My_Content_View" --organization="My_Organization"

Table 9.2. Import
IntentCommand

Import into an Organization’s Library

hammer content-import library --organization="My_Organization" --path="/var/lib/pulp/imports/My_Exported_Library_Dir"

Import to a Content View version

hammer content-import version --organization="My_Organization" --path="/var/lib/pulp/imports/My_Exported_Version_Dir"

Import a Repository

hammer content-import repository --organization="My_Organization" --path="/var/lib/pulp/imports/My_Exported_Repo_Dir"

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.