Migrating from RHN to RHSM in Red Hat Enterprise Linux [Master Article]

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux (RHEL) 5.8 or later
  • Red Hat Enterprise Linux (RHEL) 6.2 or later
  • Please note this is NOT for a Red Hat Satellite 5.x

Issue

  • How to move a system from RHN Classic to RHSM
  • How do I migrate from RHN Classic to RHSM?
  • How can I move existing systems on RHEL 5.7 from RHN Classic to Certificate Management?
  • Getting entitlement errors when trying to register a new system through the portal or command line when I have systems in both systems, how do I migrate my systems to Red Hat Subscription Management?

Resolution

Pre-requisite

How to migrate the system from RHN to RHSM
1. Check the version of subscription-manager package.

[root@localhost ~]# rpm -qa | grep subscription-manager

2. If the package does not exist setup local repository to install the package. Refer to: This content is not included. Creating a Local Repository and Sharing With Offline Systems

(Skip step 2 if the package subscription-manager already exist).

[root@localhost ~]# yum install subscription-manager

3. Change directory to edit plugins.

[root@localhost ~]# cd /etc/yum/pluginconf.d

4. Edit plugins on system : enable plugins needed for RHSM ( enabled=1 ) and disable for RHN ( enabled=0 )

  • RHN Classic Plugins:
  • rhnplugin.conf
  • refresh-packagekit.conf
  • RHSM Plugins:
  • product-id.conf
  • refresh-packagekit.conf
  • subscription-manager.conf

For Example :-

[root@localhost pluginconf.d]# vim rhnplugin.conf
[main]
enabled = 0
gpgcheck = 1

5. Clean yum

[root@localhost ~]# yum clean all
Loaded plugins: refresh-packagekit, subscription-manager
Cleaning up Everything

6. Remove (or rename) the systemid file

[root@localhost ~]# cd /etc/sysconfig/rhn
[root@localhost ~]# mv systemid rhnclassic.systemid

7. Register system to RHSM via command-line

[root@localhost ~]# subscription-manager register

I have a Virtual Datacenter Subscription , systems migrate but won't subscribe
Virtual Datacenter Subscription follows a different registration approach. So, in order to register and subscribe the system, configure the virt-who agent using Red Hat access lab. Refer to: Using RHEL Virtual Data Center Subscription.

Common FAQs

  1. How would I know if the system is successfully migrated?
    Simply execute the following commands and check the system status and attached subscription :-

For Example :-

# subscription-manager list

+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        7.3
Arch:           x86_64
Status:         Subscribed          >> Status has to be Subscribed
Status Details: 
Starts:         10/14/2016
Ends:           10/14/2017

# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux Developer Suite
Provides:     Oracle Java (for RHEL Server)
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update Support
                     Red Hat EUCJP Support (for RHEL Server) - Extended Update Support
                     dotNET on RHEL Beta (for RHEL Server)
                    ......
                    ......
                
SKU:                 RH123456
Contract:            11223344
Account:             123456
Serial:              1234567890123456
Pool ID:             1b234ab678g90123ab
Provides Management: Yes
Active:              True
Quantity Used:       1
Service Level:       Self-Support
Service Type:        L1-L3
Status Details:      Subscription is current            
Subscription Type:   Standard
Starts:              10/14/2016
Ends:                10/14/2017
System Type:         Virtual

# yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
repo id                                                                                               repo name                                                                                status
rhel-7-server-rpms/7Server/x86_64      Red Hat Enterprise Linux 7 Server (RPMs)                                14,606
rhel-7-server-rt-beta-rpms/x86_64        Red Hat Enterprise Linux for Real Time Beta (RHEL 7 Server) (RPMs)         15
repolist: 14,621

SBR
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.