Migrating from RHN Classic to Certificate-based CentOS Network
A system which was registered against the hosted subscription service, RHN Classic, can be migrated to Certificate-based CentOS Network using the rhn-migrate-classic-to-rhsm
script.
The general action is that it unregisters the system from RHN Classic, registers it with Certificate-based CentOS Network, and opens Subscription Manager (either GUI or CLI) to assign subscriptions.
The rhn-migrate-classic-to-rhsm
script has this syntax:
rhn-migrate-classic-to-rhsm [--force|--cli-only|--help|--no-auto]
After running migration, the system facts list what script was used for migration and what the previous system ID was.
[root@server ~]# subscription-manager facts --list | grep migr migration.classic_system_id: 09876 migration.migrated_from: rhn_hosted_classic
This makes it easy to track the migration process for systems within the infrastructure.
Example 14.7. Basic RHN Classic to Certificate-based CentOS Network Migration
Simply running the rhn-migrate-classic-to-rhsm
tool migrates the system profile and then opens the Subscription Manager GUI so that administrators can assign subscriptions to the system.
While administrators only have to run the command, the script itself runs through a series of steps to migrate the account.
[root@server ~]# rhn-migrate-classic-to-rhsm RHN Username: jsmith@example.com Password:
The script prompts for the username and password to use to connect to CentOS Network. It uses these credentials to authenticate to both CentOS Network Classic and Certificatebased CentOS Network, to verify the account settings.
Once the account is verified, the script creates a channel list for the system.
Retrieving existing RHN classic subscription information ... +----------------------------------+ System is currently subscribed to: +----------------------------------+ rhel-i386-client-5
Each discovered channel is then mapped to a corresponding product certificate ("Looking at Channel and Certificate Mappings"). Not every product has a product certificate, so not every channel may have a map. Only the channels with a certificate channel to a corresponding certificate map.
The matching certificates are copied into the /etc/pki/product
directory.
List of channels for which certs are being copied rhel-i386-client-5 Product Certificates copied successfully to /etc/pki/product !!
Then, the script unregisters the system from RHN Classic.
Preparing to unregister system from RHN classic ... System successfully unregistered from RHN Classic.
Then, it registers the system with Certificate-based CentOS Network.
Attempting to register system to Certificate-based RHN ... The system has been registered with id: abcd1234 System server.example.com successfully registered to Certificate-based RHN. Launching the GUI tool to manually subscribe the system ...
The last step opens the Subscription Manager GUI to the All Available Subscriptions tab so that the administrator can manually assign the subscriptions to the system.

Alternatively, the rhn-migrate-classic-to-rhsm
can automatically subscribe the system to matching subscriptions.
Example 14.8. All CLI-Based Migration
The --cli-only
option tells the rhn-migrate-classic-to-rhsm
to register the system with the autosubscribe option, so all of the migration process occurs in the command line.
The overall process is identical to the one in Example 14.7, "Basic RHN Classic to Certificate-based CentOS Network Migration" until the final step.
[root@server ~]# rhn-migrate-classic-to-rhsm --cli-only RHN Username: jsmith@example.com Password: .... Attempting to auto-subscribe to appropriate subscriptions ... Installed Product Current Status: ProductName: Red Hat Enterprise Linux Desktop Status: Subscribed Please visit https://access.redhat.com/management/consumers/abcd1234 to view the details, and to make changes if necessary.