Migration

Users of the old rhn_import binary are encouraged to migrate to the new redhat_import binary. Multiple migration paths are available as described in the following sections.

Continue usage of RHN

Users can migrate from rhn_import to redhat_import and continue to use RHN to import content. In this case the only requirement is to migrate the configuration file from the old format to the new format. For more details on the redhat_import configuration file format see redhat_import configuration file.

Once the configuration is migrated to the new format, while preserving the existing SA Library paths, redhat_import will update the existing packages and software policies, making the migration transparent. Moreover, new products that have not been imported in the SA Library can be imported from RHSM while the old products continue to be imported from RHN. For example, a user who is already importing RHEL 5 and 6 content from RHN can start importing RHEL 7 content from RHSM while still using RHN for the older RHEL 5 and 6. For a sample configuration that allows import from both RHN and RHSM see Import from both RHN and RHSM.

Partial migration to RHSM

This section only applies to users who are using the SA-recommended library paths. Users using custom SA Library paths should derive their own migration procedure based on the instructions in this section. The SA-recommended library paths are as follows:

  • RHN
    • package_path=/RHN/Packages/$channel_name
    • channel_path=/RHN/Channels/$parent_channel_name/$channel_name Policy
    • erratum_path=/RHN/Errata/$erratum_type Policies/$erratum_name
    • errata_path =/RHN/Errata/$parent_channel_name/$channel_name Advisory Roll-Up Policy
  • RHSM
    • package_path=/RHSM/Packages/$content_name
    • content_policy_path=/RHSM/Content/$content_name Policy
    • erratum_policy_path=/RHSM/Errata/$erratum_type Policies/$erratum_name
    • errata_policy_path =/RHSM/Errata/$content_name Advisory Roll-Up Policy

This section describes the scenario where a user is currently using RHN to import some channels and would like to start using RHSM to import a subset of these channels while still using RHN for the other channels.

To achieve partial migration to RHSM, perform the following steps:

  1. Migrate from rhn_import to redhat_import and convert the configuration file to the new format
  2. In the SA Library, move the channel policies of the channels that need to be migrated to the RHSM content_policy_path folder (/RHSM/Content). Rename these channel policies to content policies “$content_name Policy”. The value of the “$content_name” variable can be found in the entitlement certificate or by using --show_labels for CDN contents mapped to SA-supported platforms. This ensures that redhat_import will update these content policies instead of creating new ones.
  3. Move the errata policies of the channels that need to be migrated to the RHSM errata_policy_path folder (/RHSM/Errata). Rename these errata policies to be compliant with RHSM format “$content_name Advisory Roll-Up Policy.” The value of the “$content_name” variable can be found in the entitlement certificate or by using --show_labels for CDN contents mapped to SA-supported platforms. This ensures that redhat_import will update these errata policies instead of creating new ones.
  4. Move the package folders of the channels that need to be migrated to the RHSM package_path folder (/RHSM/Packages). Rename these package folders to be compliant with RHSM format “$content_name”. The value of the “$content_name” variable can be found in the entitlement certificate or by using --show_labels for CDN contents mapped to SA-supported platforms. This ensures that redhat_import will import packages into these folders instead of creating new folders.
  5. Ensure that redhat_import will use the same erratum library path for both RHN and RHSM. An erratum can be available in multiple RHN channels. When using the SA-recommended library paths a single erratum policy is created even for an erratum available in multiple channels and this policy is updated with content from all channels. As not all channels are migrated to RHSM the erratum policies cannot be moved to the RHSM folders. Instead, the RHSM “erratum_policy_path” is updated to point to the path used by RHN (/RHN/Errata/$erratum_type Policies/$erratum_name). The “erratum_policy_path” should be updated as described above only for the contents migrated from RHN, so for each such content a new content section needs to be defined in the configuration file and define the “erratum_policy_path” option as “/RHN/Errata/$erratum_type Policies/$erratum_name”.
  6. Finally, the configuration file should be updated to ensure that the migrated channels are no longer imported from RHN and that the new CDN contents are imported from RHSM (e.g. by updating the “content_labels” option).

Tip Review your repo.restrict. custom attributes. If any of them refer to package folders that were moved and renamed, you need to edit the attributes to make them refer to the new package folder locations.

Sample scenario: partial migration to RHSM

As an example, consider the case where the following channels are imported from RHN:

Red Hat Enterprise Linux (v. 5 for 64-bit x86_64)

Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)

The SA Library structure concerning RHN and RHSM import would initially look as shown below

Example: SA Library structure for RHN and RHSM import—before partial migration

- RHN
| - Channels
| |   Red Hat Enterprise Linux (v. 5 for 64-bit x86_64) Policy
| |   Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) Policy
| - Errata
| | + Bug Fix Advisory Policies
| | + Product Enhancement Advisory Policies
| | + Security Advisory Policies
| |   Red Hat Enterprise Linux (v. 5 for 64-bit x86_64) Advisory Roll-Up Policy
| |   Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) Advisory Roll-Up Policy
| - Packages
| | + Red Hat Enterprise Linux (v. 5 for 64-bit x86_64)
| | + Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)
- RHSM
| - Content
| - Errata
| - Packages

 

If Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) needs to be migrated to RHSM while Red Hat Enterprise Linux (v. 5 for 64-bit x86_64) continues to be imported from RHN, the partial migration steps would be as follows.

Steps for sample scenario—Partial migration to RHSM:

  1. Migrate the existing configuration file to the new format required by redhat_import. For details on the redhat_import configuration file format see redhat_import configuration file. The precise details on how to migrate the configuration file depend on the actual content of the existing configuration file. However the resulted migrated configuration is expected to allow redhat_import to import the same RHN channels into the SA Library. In other words, running rredhat_import with the migrated configuration file should yield the same result as running rhn_import with the old configuration file.
  2. Move Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) Policy policy to /RHSM/Content folder. Rename the policy to Red Hat Enterprise Linux 6 Server (RPMs) (6Server-x86_64) Policy.
  3. Move Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) Advisory Roll-Up Policy policy to /RHSM/Errata folder. Rename the policy to Red Hat Enterprise Linux 6 Server (RPMs) (6Server-x86_64) Advisory Roll-Up Policy.
  4. Move the package folder “Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)” to “/RHSM/Packages folder. Rename the package folder to “Red Hat Enterprise Linux 6 Server (RPMs) (6Server-x86_64)”.
  5. Create a new content section in the configuration file: [rhel-6-server-rpms{6Server-x86_64}]. Define the erratum_policy_path as follows under the above section: erratum_policy_path=/RHN/Errata/$erratum_type Policies/$erratum_name
  6. Update the configuration file to ensure that RHN channel “rhel-x86_64-server-6” is no longer imported from RHN and the equivalent CDN content “rhel-6-server-rpms{6Server-x86_64} is imported from RHSM.

Following this, the SA Library folders concerning RHN and RHSM import should look as shown below.

Example: SA Library folders for RHN and RHSM import—after partial migration

- RHN
| - Channels
| |   Red Hat Enterprise Linux (v. 5 for 64-bit x86_64) Policy
| - Errata
| | + Bug Fix Advisory Policies
| | + Product Enhancement Advisory Policies
| | + Security Advisory Policies
| |   Red Hat Enterprise Linux (v. 5 for 64-bit x86_64) Advisory Roll-Up Policy
| - Packages
| | + Red Hat Enterprise Linux (v. 5 for 64-bit x86_64)
- RHSM
| - Content
| |   Red Hat Enterprise Linux 6 Server (RPMs) (6Server-x86_64) Policy
| - Errata
| |   Red Hat Enterprise Linux 6 Server (RPMs) (6Server-x86_64) Advisory Roll-Up Policy
| - Packages
| | + Red Hat Enterprise Linux 6 Server (RPMs) (6Server-x86_64)

Full migration to RHSM

This section only applies to users who are using the SA-recommended library paths. Users using custom SA Library paths should derive their own migration procedure based on the instructions in this section. Also this section only applies if there are no errata imported from RHSM for any CDN content. If errata are already imported from RHSM under the SA-recommended library path (/RHSM/Errata) and you would like to migrate some or all RHN channels to RHSM please use the instructions in Partial migration to RHSM. This is because moving erratum policies from RHN folder structure to RHSM might conflict with existing erratum policies under the RHSM folder structure.

For a list of SA-recommended library paths, see Partial migration to RHSM.

This section describes the scenario where a user is currently using RHN to import some channels and would like to start using RHSM to import all of these channels. Basically, after migration, no channels will be imported from RHN. To migrate only some RHN channels to RHSM, see Partial migration to RHSM.

To achieve full migration to RHSM, perform the following steps:

  1. In the SA Library, move the channel policies of the channels that need to be migrated to the RHSM content_policy_path folder (/RHSM/Content). Rename these channel policies to content policies “$content_name Policy”. The value of the “$content_name” variable can be found in the entitlement certificate or by using --show_labels for CDN contents mapped to SA-supported platforms. This ensures that redhat_import will update these content policies instead of creating new ones.
  2. Move the errata policies of the channels that need to be migrated to the RHSM errata_policy_path”folder (/RHSM/Errata). Rename these errata policies to be compliant with RHSM format “$content_name Advisory Roll-Up Policy”. The value of the “$content_name” variable can be found in the entitlement certificate or by using --show_labels for CDN contents mapped to SA-supported platforms. This ensures that redhat_import will update these errata policies instead of creating new ones.
  3. Move the package folders of the channels that need to be migrated to the RHSM package_path folder (/RHSM/Packages). Rename these package folders to be compliant with RHSM format “$content_name”. The value of the “$content_name” variable can be found in the entitlement certificate or by using --show_labels for CDN contents mapped to SA-supported platforms. This ensures that redhat_import will import packages into these folders instead of creating new folders.
  4. Move the erratum policies folders (“Bug Fix Advisory Policies”, “Product Enhancement Advisory Policies”, “Security Advisory Policies”) to the RHSM “erratum_policy_path” (/RHSM/Errata).
  5. Migrate from rhn_import to redhat_import and convert the configuration file to the new format. During the migration process ensure that no channels are imported from RHN and that the new CDN contents are imported from RHSM (e.g. by updating the “content_labels” option). The [RHN] section should not be present in the redhat_import configuration file.

Tip Review your repo.restrict. custom attributes. If any of them refer to package folders that were moved and renamed, you need to edit the attributes to make them refer to the new package folder locations.

Sample scenario: full migration to RHSM

As an example, consider the case where the following channels are imported from RHN:

  • Red Hat Enterprise Linux (v. 5 for 64-bit x86_64)
  • Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)

The SA Library structure concerning RHN and RHSM import would initially look as shown below

Example: SA Library folders for RHN and RHSM import—before full migration

- RHN
| - Channels
| |   Red Hat Enterprise Linux (v. 5 for 64-bit x86_64) Policy
| |   Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) Policy
| - Errata
| | + Bug Fix Advisory Policies
| | + Product Enhancement Advisory Policies
| | + Security Advisory Policies
| |   Red Hat Enterprise Linux (v. 5 for 64-bit x86_64) Advisory Roll-Up Policy
| |   Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) Advisory Roll-Up Policy
| - Packages
| | + Red Hat Enterprise Linux (v. 5 for 64-bit x86_64)
| | + Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)
- RHSM
| - Content
| - Errata
| - Packages


If both “Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)” and “Red Hat Enterprise Linux (v. 5 for 64-bit x86_64)” channels need to be migrated to RHSM, the full migration steps would be as follows:

Steps for Sample Scenario—pull migration to RHSM:

  1. Move the following software policies to /RHSM/Content folder:
    • Red Hat Enterprise Linux (v. 5 for 64-bit x86_64) Policy
    • Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) Policy

      Rename the policies to:

      • Red Hat Enterprise Linux 5 Server (RPMs) (5Server-x86_64) Policy
      • Red Hat Enterprise Linux 6 Server (RPMs) (6Server-x86_64) Policy
  2. Move the following software policies to “/RHSM/Errata” folder:
    • Red Hat Enterprise Linux (v. 5 for 64-bit x86_64) Advisory Roll-Up Policy
    • Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) Advisory Roll-Up Policy

      Rename the policies to:
      • Red Hat Enterprise Linux 5 Server (RPMs) (5Server-x86_64) Advisory Roll-Up Policy
      • Red Hat Enterprise Linux 6 Server (RPMs) (6Server-x86_64) Advisory Roll-Up Policy
  3. Move the following package folders to /RHSM/Packages folder:
    • Red Hat Enterprise Linux (v. 5 for 64-bit x86_64)
    • Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64)
      Rename the folders to:
      • Red Hat Enterprise Linux 5 Server (RPMs) (5Server-x86_64)
      • Red Hat Enterprise Linux 6 Server (RPMs) (6Server-x86_64)
  4. Move the erratum policies folders (Bug Fix Advisory Policies, Product Enhancement Advisory Policies, Security Advisory Policies) to /RHSM/Errata.
  5. Migrate the configuration file and ensure that the CDN contents “rhel-5-server-rpms{5Server-x86_64}” and “rhel-6-server-rpms{6Server-x86_64}” are imported from RHSM. There should be no [RHN] section in the redhat_import configuration file as no channels are imported from RHN.

After the above steps are completed, the SA Library folders concerning RHN and RHSM import should look as shown in below.

Example: SA Library folders for RHN and RHSM import—after full migration

- RHN
| - Channels
| - Errata
| - Packages
- RHSM
| - Content
| |   Red Hat Enterprise Linux 5 Server (RPMs) (5Server-x86_64) Policy
| |   Red Hat Enterprise Linux 6 Server (RPMs) (6Server-x86_64) Policy
| - Errata
| | + Bug Fix Advisory Policies
| | + Product Enhancement Advisory Policies
| | + Security Advisory Policies
| |   Red Hat Enterprise Linux 5 Server (RPMs) (5Server-x86_64) Advisory Roll-Up Policy
| |   Red Hat Enterprise Linux 6 Server (RPMs) (6Server-x86_64) Advisory Roll-Up Policy
| - Packages
| | + Red Hat Enterprise Linux 5 Server (RPMs) (5Server-x86_64)
| | + Red Hat Enterprise Linux 6 Server (RPMs) (6Server-x86_64)