Synchronizing content between orcharhino Servers
In a orcharhino setup with multiple orcharhino Servers, you can use Inter-Server Synchronization (ISS) to synchronize content from one upstream server to one or more downstream servers.
There are two possible ISS configurations of orcharhino, depending on how you deployed your infrastructure:
- ISS Network Sync
-
If your upstream server can communicate with the downstream server over a network, you can synchronize content over HTTPS.
Configure your orcharhino to synchronize content over a network. For more information, see configuring server to synchronize content over a network.
- ISS Export Sync
-
If your upstream and downstream servers are air-gapped, you can synchronize content using export and import.
Configure your orcharhino to synchronize content using export and import. For more information, see configuring projectserver to synchronize content by using exports.
-
For more information on ISS use cases and scenarios, see iss scenarios.
Content synchronization by using export and import
There are multiple approaches for synchronizing content by using the export and import workflow:
-
You employ the upstream orcharhino 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 content view versions downstream. For more information, see Using Upstream Server as a Content Store.
-
You use the upstream orcharhino Server to sync content view versions. This approach offers more control over what content is synced between orcharhino Servers. For more information, see Using Upstream Server to Synchronize 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 synchronizing a single repository.
Synchronizing content by using export and import requires the same major, minor, and patch version of orcharhino on both the downstream and upstream orcharhino Servers. When you are unable to match upstream and downstream orcharhino versions, you can use:
|
Using an upstream orcharhino Server as a content store
In this scenario, you use the upstream orcharhino Server as a content store for updates rather than to manage content. You use the downstream orcharhino Server to manage content for all infrastructure behind the isolated network. You export the Library content from the upstream orcharhino Server and import it into the downstream orcharhino Server.
-
Ensure that repositories are using the Immediate download policy in one of the following ways:
-
For existing repositories using On Demand, change their download policy on the repository details page to Immediate.
-
Ensure that the Default download policy is set to Immediate for custom repositories.
For more information, see Download Policies Overview.
-
-
Enable the content that you want to synchronize.
If you want to sync custom content, first create a custom product and then synchronize repositories.
-
Synchronize the enabled content:
-
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 orcharhino Servers. For more information on performing a complete Library export, see Exporting the Library Environment. -
Export all future updates on the upstream orcharhino 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 exporting the library environment incrementally.
-
-
Bring the content exported from the upstream orcharhino Server over to the hard disk.
-
Place it inside a directory under
/var/lib/pulp/imports
. -
Import the content to an organization using the procedure outlined in Importing into the Library Environment.
You can then manage content using content views or lifecycle environments as you require.
Using an upstream orcharhino Server to synchronize content view versions
In this scenario, you use the upstream orcharhino 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 orcharhino Server and import it into the downstream orcharhino Server.
-
Ensure that repositories are using the Immediate download policy in one of the following ways:
-
For existing repositories using On Demand, change their download policy on the repository details page to Immediate.
-
Ensure that the Default download policy is set to Immediate for custom repositories.
For more information, see Download Policies Overview.
-
-
Enable the content that you want to synchronize.
If you want to sync custom content, first create a custom product and then synchronize repositories.
-
Synchronize the enabled content:
-
For the first export, perform a
complete
version export on the content view version that you want to export. For more information see, Exporting a Content View Version. This generates content archives that you can import into one or more downstream orcharhino Servers. -
Export all future updates in the connected orcharhino 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 Exporting a Content View Version Incrementally.
-
When you have new content, republish the content views that include this content before exporting the increment. For more information, see Managing Content Views. This creates a new content view version with the appropriate content to export.
-
-
Bring the content exported from the upstream orcharhino Server over to the hard disk.
-
Place it inside a directory under
/var/lib/pulp/imports
. -
Import the content to the organization that you want. For more information, see Importing a Content View Version. This will create a content view version from the exported content archives and then import content appropriately.
Synchronizing a single repository
In this scenario, you export and import a single repository.
-
Ensure that the repository is using the Immediate download policy in one of the following ways:
-
For existing repositories using On Demand, change their download policy on the repository details page to Immediate.
-
Ensure that the Default download policy is set to Immediate for custom repositories.
For more information, see Download Policies Overview.
-
-
Enable the content that you want to synchronize.
If you want to sync custom content, first create a custom product and then synchronize product repositories.
-
Synchronize the enabled content:
-
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 orcharhino Servers. For more information on performing a complete repository export, see Exporting a Repository. -
Export all future updates on the upstream orcharhino 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 Exporting Repository Incrementally.
-
-
Bring the content exported from the upstream orcharhino Server over to the hard disk.
-
Place it inside a directory under
/var/lib/pulp/imports
. -
Import the content to an organization. See Importing a Repository.
You can then manage content using content views or lifecycle environments as you require.
Synchronizing a custom repository
When using Inter-Server 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 orcharhino Server to a disconnected orcharhino Server through Inter-Server Synchronization (ISS) Network Sync.
Follow the procedure for the connected orcharhino Server before completing the procedure for the disconnected orcharhino Server.
-
In the orcharhino management UI, navigate to Content > Products.
-
Click on the custom product.
-
Click on the custom repository.
-
Copy the Published At: URL.
-
Continue with the procedure on disconnected orcharhino Server.
-
Download the
katello-server-ca.crt
file from the connected orcharhino Server:$ curl http://orcharhino.example.com/pub/katello-server-ca.crt
-
Create an SSL Content Credential with the contents of
katello-server-ca.crt
. For more information on creating an SSL Content Credential, see Importing Custom SSL Certificates. -
In the orcharhino management UI, navigate to Content > Products.
-
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 orcharhino Server.
For more information on creating a custom product, see Creating a Custom Product.
-
After completing these steps, the custom repository is properly configured on the disconnected orcharhino Server.
Exporting the Library environment
You can export content in the Library environment of an organization to an archive file from orcharhino Server and use this archive file to create the same repositories in another orcharhino Server or in another orcharhino 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.
You can export the following content from orcharhino Server:
-
Ansible collections
-
Deb content
-
Docker content
-
File type content
-
Kickstart repositories
-
Yum content
-
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 Download Policies Overview.
-
Ensure that you synchronize products that you export to the required date.
-
Use the organization name or ID to export.
$ hammer content-export complete library --organization="My_Organization"
-
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
, thetoc.json
, and themetadata.json
file to be able to import. -
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.
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/
Exporting the library environment in a syncable format
You can export content 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 use the generated content to create the same repository in another orcharhino Server or in another orcharhino Server organization by using content import. On import of the exported archive, a regular content view is created or updated on your importing orcharhino Server. For more information, see Importing a Content View Version.
You can export the following content types in the syncable format from orcharhino Server:
-
File type content
-
Kickstart repositories
-
Yum content
You cannot export Ansible collections, Deb content, or Docker content in the syncable format.
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 orcharhino Server.
-
Ensure that you set the download policy to Immediate for all repositories within the Library lifecycle environment you export. For more information, see 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.
-
Use the organization name or ID to export:
$ hammer content-export complete library \ --organization="My_Organization" \ --format=syncable
-
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
Importing syncable exports
-
Use the organization name or ID to import syncable exports:
$ hammer content-import library --organization="My_Organization" --path="My_Path_To_Syncable_Export"
Syncable exports must be located in one of your |
Exporting the Library environment incrementally
Exporting Library content can be a very expensive operation in terms of system resources. The size of the exported Library depends on the number of products. Organizations that have multiple CentOS Stream trees can occupy several gigabytes of space on orcharhino Server.
In such cases, you can create an incremental export which contains only pieces of content that have changed since the last export. Incremental exports typically result in smaller archive files than the full exports.
You can export the following content from orcharhino Server:
-
Ansible collections
-
Deb content
-
Docker content
-
File type content
-
Kickstart repositories
-
Yum content
The example below shows incremental export of all repositories in the organization’s Library.
-
Create an incremental export:
$ hammer content-export incremental library \ --organization="My_Organization"
If you want to create a syncable export, add
--format=syncable
. By default, orcharhino creates an importable export.
-
Optional: View the exported data:
$ find /var/lib/pulp/exports/My_Organization/Export-Library/
Exporting a content view version
You can export a version of a content view to an archive file from orcharhino Server and use this archive file to create the same content view version on another orcharhino Server or on another orcharhino Server organization. orcharhino 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 orcharhino 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
You can export the following content from orcharhino Server:
-
Ansible collections
-
Deb content
-
Docker content
-
File type content
-
Kickstart repositories
-
Yum content
orcharhino does not export content view definitions and metadata such as package filters.
To export a content view, ensure that orcharhino 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 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.
-
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 | | ---|----------|---------|-------------|----------------------
-
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"
-
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.
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/
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 orcharhino 7.0.
You can use the generated content to create the same repository in another orcharhino Server or in another orcharhino Server organization using content import. On importing the exported archive, a regular content view is created or updated on your downstream orcharhino Server.
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 orcharhino Server.
You can export the following content types in the syncable format from orcharhino Server:
-
File type content
-
Kickstart repositories
-
Yum content
You cannot export Ansible collections, Deb content, or Docker content in the syncable format.
-
Ensure that you set the download policy to Immediate for all repositories within the content view you export. For more information, see 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.
-
List versions of the content view that are available for export:
$ hammer content-view version list \ --content-view="My_Content_View" \ --organization="My_Organization"
-
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
-
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/
Exporting a content view version incrementally
Exporting complete content view versions can be a very expensive operation in terms of system resources. The size of the exported content view versions depends on the number of products. Content view versions that have multiple CentOS Stream trees can occupy several gigabytes of space on orcharhino Server.
In such cases, you can create an incremental export which contains only pieces of content that have changed since the last export. Incremental exports typically result in smaller archive files than the full exports.
You can export the following content from orcharhino Server:
-
Ansible collections
-
Deb content
-
Docker content
-
File type content
-
Kickstart repositories
-
Yum content
-
Create an incremental export:
$ hammer content-export incremental version \ --content-view="My_Content_View" \ --organization="My_Organization" \ --version="My_Content_View_Version"
If you want to create a syncable export, add
--format=syncable
. By default, orcharhino creates an importable export.
-
Optional: View the exported content view:
$ find /var/lib/pulp/exports/My_Organization/My_Exported_Content_View/My_Content_View_Version/
-
You can import your exported content view version into orcharhino Server. For more information, see Importing a Content View Version.
Exporting a repository
You can export the content of a repository in the Library environment of an organization from orcharhino Server. You can use this archive file to create the same repository in another orcharhino Server or in another orcharhino Server organization.
You can export the following content from orcharhino Server:
-
Ansible collections
-
Deb content
-
Docker content
-
File type content
-
Kickstart repositories
-
Yum 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.
-
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 Download Policies Overview.
-
Ensure that you synchronize products that you export to the required date.
-
Export a repository:
$ hammer content-export complete repository \ --name="My_Repository" \ --product="My_Product" \ --organization="My_Organization"
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
. -
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/
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 use the generated content to create the same repository in another orcharhino Server or in another orcharhino Server organization using content import. On importing the exported archive, a regular content view is created or updated on your downstream orcharhino Server.
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 orcharhino Server.
You can export the following content types in the syncable format from orcharhino Server:
-
File type content
-
Kickstart repositories
-
Yum content
You cannot export Ansible collections, Deb content, or Docker content in the syncable format.
-
Ensure that you set the download policy to Immediate for the repository within the Library lifecycle environment you export. For more information, see Download Policies Overview.
-
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
-
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
Exporting a repository incrementally
Exporting a repository can be a very expensive operation in terms of system resources. A typical CentOS Stream tree may occupy several gigabytes of space on orcharhino 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.
You can export the following content from orcharhino Server:
-
Ansible collections
-
Deb content
-
Docker content
-
File type content
-
Kickstart repositories
-
Yum content
The example below shows incremental export of a repository in the Library lifecycle environment.
-
Create an incremental export:
$ hammer content-export incremental repository \ --name="My_Repository" \ --organization="My_Organization" \ --product="My_Product"
-
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
Exporting a repository incrementally in a syncable format
Exporting a repository can be a very expensive operation in terms of system resources. A typical CentOS Stream tree may occupy several gigabytes of space on orcharhino 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.
You can export the following content types in the syncable format from orcharhino Server:
-
File type content
-
Kickstart repositories
-
Yum content
You cannot export Ansible collections, Deb content, or Docker content in the syncable format.
The procedure below shows an incremental export of a repository in the Library lifecycle environment.
-
Create an incremental export:
$ hammer content-export incremental repository \ --format=syncable \ --name="My_Repository" \ --organization="My_Organization" \ --product="My_Product"
-
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"
Keeping track of your exports
orcharhino keeps records of all exports. Each time you export content on the upstream orcharhino 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 orcharhino Server for several downstream orcharhino 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.
-
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
-
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
-
List content exports using the following command:
$ hammer content-export list --organization="My_Organization"
Importing into the Library environment
You can import exported Library content into the Library lifecycle environment of an organization on another orcharhino Server. For more information about exporting contents from the Library environment, see Exporting the Library Environment.
-
The exported files must be in a directory under
/var/lib/pulp/imports
. -
The user importing the content must have the Content Importer Role.
-
Copy the exported files to a subdirectory of
/var/lib/pulp/imports
on orcharhino Server where you want to import. -
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
-
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
-
Identify the Organization that you wish to import into.
-
To import the Library content to orcharhino 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. -
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 orcharhino management UI.
Import-Library
is not meant to be assigned directly to hosts. Instead, assign your hosts toDefault Organization View
or another content view as you would normally. -
The importing orcharhino Server extracts the
/var/lib/pulp/imports
directory to/var/lib/pulp/
. You can empty the/var/lib/pulp/imports
directory after a successful import.
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 orcharhino Server. For more information about exporting contents from the Library environment, see Exporting the Library Environment.
-
The exported files must be in a syncable format.
-
The exported files must be accessible through HTTP/HTTPS.
-
The user importing the content view version must have the Content Importer role.
-
Identify the Organization that you wish to import into.
-
To import the Library content to orcharhino 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 orcharhino management UI.
Import-Library
is not meant to be assigned directly to hosts. Instead, assign your hosts toDefault Organization View
or another content view.
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 orcharhino Server. For more information about exporting a content view version, see 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.
-
The exported files must be in a directory under
/var/lib/pulp/imports
. -
The user importing the content view version must have the Content Importer Role.
-
Copy the exported files to a subdirectory of
/var/lib/pulp/imports
on orcharhino Server where you want to import. -
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/
-
Verify that the ownership is set correctly:
$ ls -lh /var/lib/pulp/imports/2021-02-25T21-15-22-00-00/
-
To import the content view version to orcharhino 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. -
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
-
The importing orcharhino Server extracts the
/var/lib/pulp/imports
directory to/var/lib/pulp/
. You can empty the/var/lib/pulp/imports
directory after a successful import.
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 orcharhino Server. For more information about exporting a content view version, see 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.
-
The exported files must be in a syncable format.
-
The exported files must be accessible through HTTP/HTTPS.
-
The user importing the content view version must have the Content Importer role.
-
Import the content view version into orcharhino Server:
$ hammer content-import version \ --organization=My_Organization \ --path=http://server.example.com/pub/exports/2021-02-25T21-15-22-00-00/
Importing a repository
You can import an exported repository into an organization on another orcharhino Server. For more information about exporting content of a repository, see Exporting a Repository.
-
The export files must be in a directory under
/var/lib/pulp/imports
. -
The user importing the content must have the Content Importer Role.
-
Copy the exported files to a subdirectory of
/var/lib/pulp/imports
on orcharhino Server where you want to import. -
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
-
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
-
Identify the Organization that you wish to import into.
-
To import the repository content to orcharhino 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. -
To verify that you imported the repository, check the contents of the product and repository.
-
The importing orcharhino Server extracts the
/var/lib/pulp/imports
directory to/var/lib/pulp/
. You can empty the/var/lib/pulp/imports
directory after a successful import.
Importing a repository from a web server
You can import an exported repository directly from a web server into an organization on another orcharhino Server. For more information about exporting the content of a repository, see Exporting a Repository.
-
The exported files must be in a syncable format.
-
The exported files must be accessible through HTTP/HTTPS.
-
The user importing the content view version must have the Content Importer Role.
-
Select the organization into which you want to import.
-
To import the repository to orcharhino 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/
Exporting and importing content using Hammer CLI cheat sheet
Intent | Command |
---|---|
Fully export an Organization’s Library |
|
Incrementally export an Organization’s Library (assuming you have exported something previously) |
|
Fully export a content view version |
|
Export a content view version promoted to the Dev Environment |
|
Export a content view in smaller chunks (2-GB slabs) |
|
Incrementally export a content view version (assuming you have exported something previously) |
|
Fully export a Repository |
|
Incrementally export a Repository (assuming you have exported something previously) |
|
List exports |
|
Intent | Command |
---|---|
Import into an Organization’s Library |
|
Import to a content view version |
|
Import a Repository |
|
The text and illustrations on this page are licensed by ATIX AG under a Creative Commons Attribution Share Alike 4.0 International ("CC BY-SA 4.0") license. This page also contains text from the official Foreman documentation which uses the same license ("CC BY-SA 4.0"). |