# Step-by-Step Guide to Migrate from CentOS to Red Hat Enterprise Linux Using Convert2RHEL

### Introduction: Benefits of Migrating from CentOS to RHEL

CentOS မှ Red Hat Enterprise Linux (RHEL) သို့ Migratingလုပ်ခြင်းသည် အများအပြား အကျိုးကျေးဇူးများကို ပေးစွမ်းနိုင်ပါသည်။ အောက်ပါအချက်များသည် RHEL သို့ Migratingလုပ်ခြင်း၏ အဓိက အကျိုးကျေးဇူးများဖြစ်ပါသည်။

1. **Official Support and Assurance**  
    RHEL သည် Red Hat မှ official support and assurance ကို ပေးသည်။ critical situations များတွင် အချိန်မရွေး professional help ရရှိနိုင်ခြင်းကြောင့် system stability and security ကို မြှင့်တင်ပေးသည်။
    
2. **Enhanced Security**  
    RHEL သည် advanced security features and technologies များကို ပံ့ပိုးပေးသည်။ security vulnerabilities အတွက် အရေးကြီးသောupdates and patches များကို အချိန်မီရရှိနိုင်သည်။
    
3. **High Performance**  
    RHEL သည် high performance system တစ်ခုဖြစ်ပြီး, robust capabilities and efficiency ကို ပံ့ပိုးပေးသည်။ အထူးသဖြင့်, reliable and powerful systems များ လိုအပ်သည့် large enterprises and organizations များအတွက် သင့်တော်သည်။
    
4. **Advanced Technologies**  
    RHEL သည် the latest technologies and innovations support ပေးသည်။ ၎င်းသည် သင့် system’s capabilities ကို မြှင့်တင်ရန်အတွက် နောက်ဆုံးပေါ် tools and features များကို အသုံးချနိုင်စေပါသည်။
    
5. **Superior Management**  
    RHEL သည် system management အတွက် advanced management tools and technologies များကို ပံ့ပိုးပေးသည့် အတွက် system management ကို လွယ်ကူစွာ ပြုလုပ်နိုင်သည်။၎င်းတွင် monitoring, automation, and configuration management အတွက် tools များ ပါဝင်သည်။
    
6. **Scalability and Flexibility**  
    RHEL သည် highly scalable and flexible ဖြစ်သောကြောင့် အမျိုးမျိုးသော workloads and environments များတွင် လွယ်ကူစွာ လိုက်လျောညီထွေဖြစ်စေပါသည်။ ၎င်းသည် ကြီးထွားလာသော businesses and dynamic IT landscapes များအတွက် အကောင်းဆုံး ရွေးချယ်မှုတစ်ခု ဖြစ်စေပါသည်။
    
    CentOS မှ RHEL သို့ migrating လုပ်ခြင်းသည် official support, enhanced security, high performance, advanced technologies, superior management, scalability များအတွက် အကျိုးကျေးဇူးများကို ပေးစွမ်းနိုင်သည်။ ဒီအကျိုးကျေးဇူးများကြောင့် RHEL သို့ migration လုပ်ခြင်းသည် မည်သည့် enterprise အတွက်မဆို ဆွဲဆောင်မှုရှိသော ရွေးချယ်မှုတစ်ခုဖြစ်စေသည်။
    
    # Introduction
    
    CentOS မှ Red Hat Enterprise Linux (RHEL) သို့ Migrating လုပ်ခြင်းသည် ရှုပ်ထွေးနိုင်ပါသည်။ သို့သော် **Convert2RHEL** utility tool ကို အသုံးပြုခြင်းဖြင့် လုပ်ငန်းစဉ်ကို လွယ်ကူစေသည်။ ယင်း tool သည် RHEL-like distributions များမှ officially supported ထားသော RHEL instances များဆီသို့ ချောမွေ့စွာ Migrating နိုင်စေပြီး သင့်ရဲ့ customizations, configurations, နှင့် workloads များကို ထိန်းသိမ်းထားကြောင်း သေချာစေပါသည်။
    
    Convert2RHEL သည် Red Hat မှ supported သော tool တစ်ခုဖြစ်ပြီး Migrating လုပ်စဉ်အတွင်း ပြဿနာတစ်စုံတစ်ရာ ကြုံတွေ့ပါက Red Hat Support မှ ဆက်သွယ် အကူအညီတောင်းနိုင်ပါသည်။ RHEL installation/Migration process မစခင်မှာ သင့် CentOS Linux system ကို up-to-date ဖြစ်ကြောင်း သေချာစေရန် လိုအပ်ပါသည်။
    

### **Step 1 : Verifying Your CentOS Version**

Migrating မလုပ်ဆောင်မီ သင်၏ CentOS Version သည် နောက်ဆုံးထွက်ထားသည့် Version ဖြစ်ကြောင်း အတည်ပြုရန်လိုအပ်ပါသည်။

```plaintext
cat /etc/centos-release
```

ထွက်လာမည့် output သည် အောက်ပါအတိုင်း ဖြစ်ပါသည်။

```plaintext
CentOS Linux release 7.9.2009 (Core)
```

### **Step 2 : Enabling the Convert2RHEL Repository**

Convert2RHEL သည် Red Hat က ထုတ်ဝေသည့် package တစ်ခုဖြစ်ပြီး Red Hat CDN မှ download ပြုလုပ်နိုင်ပါသည်။ သင်၏ CentOS server သည် Red Hat CDN နှင့် subscribed မရှိသေးပါက Convert2RHEL repository ကို အရင်ဆုံး enable လုပ်ရန်လိုအပ်ပါသည်။

### **Step 2.1 : Pull Down the GPG Signing Key**

GPG key ကို download လုပ်ရန် အောက်ပါ command ကို အသုံးပြုပါ။

```plaintext
curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://www.redhat.com/security/data/fd431d51.txt
```

```plaintext
# curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://www.redhat.com/security/data/fd431d51.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1855  100  1855    0     0   2324      0 --:--:-- --:--:-- --:--:--  2324
```

### **Step 2.2 : Download the SSL Certificate**

SSL certificate ကို download လုပ်ပြီး connection ကို လုံခြုံစေရန် အောက်ပါ command ကို အသုံးပြုပါ။

```plaintext
curl --create-dirs -o /etc/rhsm/ca/redhat-uep.pem https://ftp.redhat.com/redhat/convert2rhel/redhat-uep.pem
```

```plaintext
# curl --create-dirs -o /etc/rhsm/ca/redhat-uep.pem https://ftp.redhat.com/redhat/convert2rhel/redhat-uep.pem
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7411  100  7411    0     0  15260      0 --:--:-- --:--:-- --:--:-- 15280
```

### **Step 2.3 : Download the Convert2RHEL Repository File**

Convert2RHEL repository ကို server တွင် ထည့်သွင်းရန် အောက်ပါ command ကို အသုံးပြုပါ။

```plaintext
curl -o /etc/yum.repos.d/convert2rhel.repo https://ftp.redhat.com/redhat/convert2rhel/7/convert2rhel.repo
```

```plaintext
# curl -o /etc/yum.repos.d/convert2rhel.repo https://ftp.redhat.com/redhat/convert2rhel/7/convert2rhel.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   247  100   247    0     0    509
```

### **Step 3 : Installing Convert2RHEL**

Repository ကို enabled လုပ်ပြီးသည့်အခါ Convert2RHEL utility ကို install လုပ်နိုင်ပါပြီ။ယခင်အဆင့်တွင် သင်သည် Convert2RHEL software repository ကို enabled လုပ်ထားသည်။ ၎င်းသည် သင်၏ CentOS Linux server အား convert2rhel RPM packages နှင့် Red Hat CDN မှ ၎င်း၏ dependencies များကို အသုံးပြုနိုင်စေခဲ့သည်။ Convert2RHEL repo ကို enabled လုပ်ထားကြောင်းစစ်ဆေးပါ-

### **Step 3.1 : Verify the Repository**

Convert2RHEL repository ကို enabled ဖြစ်ကြောင်း စစ်ဆေးရန် အောက်ပါ command ကို အသုံးပြုပါ။

```plaintext
yum repolist
```

```plaintext
# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.pasteur.fr
 * extras: centos.mirror.ate.info
 * updates: ftp.pasteur.fr
repo id                                                                                   repo name                                                                          status
base/7/x86_64                                                                             CentOS-7 - Base                                                                    10,072
convert2rhel-for-rhel-7-rpms                                                              Convert2RHEL for OS 7                                                                   5
extras/7/x86_64                                                                           CentOS-7 - Extras                                                                     512
updates/7/x86_64                                                                          CentOS-7 - Updates                                                                  4,053
repolist: 14,642
```

### **Step 3.2 : Install the Convert2RHEL Utility**

Convert2RHEL ကို အောက်ပါအတိုင်း Install လုပ်ပါ။

```plaintext
yum install -y convert2rhel
```

```plaintext
# yum install -y convert2rhel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.pasteur.fr
 * extras: centos.mirror.ate.info
 * updates: ftp.pasteur.fr
Resolving Dependencies
--> Running transaction check

... output truncated ...

Installed:
  convert2rhel.noarch 0:0.26-1.el7

Dependency Installed:
  libxml2-python.x86_64 0:2.9.1-6.el7_9.6  pexpect.noarch 0:2.3-11.el7             python-backports.x86_64 0:1.0-8.el7  python-backports-ssl_match_hostname.noarch 0:3.5.0.1-1.el7
  python-chardet.noarch 0:2.2.1-3.el7      python-ipaddress.noarch 0:1.0.16-2.el7  python-kitchen.noarch 0:1.1.1-5.el7  python-setuptools.noarch 0:0.9.8-7.el7
  python-six.noarch 0:1.9.0-2.el7          yum-utils.noarch 0:1.1.31-54.el7_8

Complete!
```

Convert2RHEL Install လုပ်ပြီးပါက Migrating Process ကို ဆက်လက်ဆောင်ရွက်နိုင်ပါပြီ။

### **Step 4 : Pre-Conversion Analysis**

**Understanding the Convert2RHEL command**

Conversion process ကို အကောင်အထည်ဖော်ရန် အသုံးပြုနိုင်သော arguments များစွာ ရှိသည်။ အဓိကအချက်မှာ သင်၏ new RHEL system ကို active subscription တစ်ခုနှင့် တွဲဖက်registering လုပ်ခြင်း ဖြစ်သည်။ သင့်အနေဖြင့် ရွေးချယ်နိုင်သော နည်းလမ်းများမှာ:

1. Fully interactive session: Conversion ၏ အစိတ်အပိုင်းတစ်ခုအဖြစ် မေးခွန်းများကို ဖြေဆိုခြင်းနှင့် username နှင့် password ကို ထည့်သွင်းရန် လိုအပ်သည်။
    
2. convert2rhel command အတွင်း username နှင့် password ကို ထည့်သွင်းခြင်း။ ၎င်းသည် သင်၏ Red Hat customer portal အတွက် credentials များကို server ၏ Bash history တွင် plain text အဖြစ် သိမ်းဆည်းထားရန်ဖြစ်သောကြောင့် ကောင်းမွန်သော နည်းလမ်း မဟုတ်ပါ။
    
3. command ၏ အစိတ်အပိုင်းတစ်ခုအဖြစ် သင့် Organization ID နှင့် Activation Key ကို ထည့်သွင်းခြင်း။ ၎င်းသည် more secure ဖြစ်တယ် သင့် org-id ကို ရှာဖွေပါ၊ activation key ကို ဖန်တီးပါ။
    

### **Step 4.1 : Running the Convert2RHEL analyze utility**

Conversion ကို automate လုပ်ရန် အောက်ပါ command ကို အသုံးပြုပါ။

```plaintext
convert2rhel --org < ORG ID > --activationkey  < KEY >
```

ဤလုပ်ငန်းစဉ်ကို automated ဖြစ်စေရန်အတွက်၊ အပေါ်တွင်ဖော်ပြထားသော နံပါတ် 3 မှ activation key combination ကို အသုံးပြုပြီး conversion analysis ကို စတင်မည်ဖြစ်သည်။

```plaintext
convert2rhel analyze --org 12451665 --activationkey convert2rhel
```

Note: This process will take some time!

```plaintext
# convert2rhel analyze --org 12451665 --activationkey convert2rhel -y

[07/22/2022 18:40:54] TASK - [Prepare: Show Red Hat software EULA] ******************************
The following text is a copy of the November 18, 2019 version of Red Hat GPLv2-Based End User License Agreement (EULA) [1].
For up-to-date version of the EULA, visit [2].
[1] https://www.redhat.com/licenses/Red_Hat_GPLv2-Based_EULA_20191118.pdf
[2] https://www.redhat.com/en/about/agreements

... output truncated ...

Package                                                  Vendor/Packager  Repository
-------                                                  ---------------  ----------
epel-release-7-14.noarch                                 Fedora Project   /epel-release-latest-7.noarch
google-compute-engine-oslogin-20220714.00-g1.el7.x86_64  N/A              google-compute-engine
google-guest-agent-20220713.00-g1.el7.x86_64             N/A              google-compute-engine
google-compute-engine-20220211.00-g1.el7.noarch          N/A              google-compute-engine
gce-disk-expand-20200716.00-g1.el7.x86_64                N/A              google-compute-engine
google-osconfig-agent-20220711.00-g1.el7.x86_64          N/A              google-compute-engine
google-cloud-sdk-396.0.0-1.x86_64                        N/A              google-cloud-sdk
```

Process ကို ဆက်လက်လုပ်ဆောင်ရန် **<mark>y</mark>** ရိုက်ထည့်ပြီး enter နှိပ်ပါ။

### **Step 4.2 : Reviewing the analysis**

Outdated/Invalid kernel ကဲ့သို့သော error များကို တွေ့ရှိပါက၊ Convert2RHEL tool သည် ပြန်လည်ပြင်ဆင်ခြင်း steps များကို ပေးပါလိမ့်မည်။ ဥပမာအားဖြင့်၊ သင်သည် kernel ဗားရှင်းမတူညီမှုကို ကြုံတွေ့ရပါက၊

```plaintext
========== Error (Must fix before conversion) ==========
(ERROR) IS_LOADED_KERNEL_LATEST::INVALID_KERNEL_VERSION - Invalid kernel version detected
     Description: The loaded kernel version mismatch the latest one available in the enabled system repositories
     Diagnosis: The version of the loaded kernel is different from the latest version in the enabled system repositories.
     Latest kernel version available in updates: 3.10.0-1160.108.1.el7
     Loaded kernel version: 3.10.0-1160.102.1.el7
     Remediation: To proceed with the conversion, update the kernel version by executing the following step:

    1. yum install kernel-3.10.0-1160.108.1.el7 -y
    2. reboot
```

ဤပြဿနာကို ပြန်လည်ဖြေရှင်းရန်၊ အောက်ပါ command ကိုရိုက်ထည့်ပါ။

```plaintext
yum update -y && reboot
```

### **Step 5 : Running Convert2RHEL**

ယခုသင် inhibitor ကို fixed လုပ်ပြီးသည်နှင့်သင်၏ system ကို RHEL သို့ပြောင်းမည်ဖြစ်သည်။

### **Step 5.1 : Running the conversion**

```plaintext
convert2rhel --org 12451665 --activationkey convert2rhel -y
```

```plaintext
... output truncated ...

[07/22/2022 18:42:43] TASK - [Convert: Final system checks before main conversion] **************
Comparing the loaded kernel modules with the modules available in the following RHEL kernel packages available in the enabled repositories:

... output truncated ...

[07/22/2022 18:48:33] TASK - [Final: Remove temporary folder /var/lib/convert2rhel/] ************
Temporary folder /var/lib/convert2rhel/ removed

Conversion successful!

WARNING - In order to boot the RHEL kernel, restart of the system is needed.
```

Conversion ပြီးမြောက်ရန် 15 မိနစ်ခန့် ကြာနိုင်သည်။အပြောင်းအလဲများကို effect ဖြစ်စေရန် သင်သည် system အား reboot လုပ်ရန် လိုအပ်မည်ဖြစ်ပါသည်။

```plaintext
reboot
```

convert2rhel utility ကို run ခြင်းဖြင့်၊ System သည် ယခု CentOS signed packages များကို Red Hat signed versions များဖြင့် အစားထိုးပါမည်။ System ည် အချိန်အနည်းငယ် Reboot ပါမည်-

1: first time - ဤအပြောင်းအလဲများပြုလုပ်ရန် temporary environment သို့ boot စတင်

2: second time - SELinux contexts များပေါ်တွင် relabel ထည့်သွင်းရန်

3: final time - အသစ်ဖန်တီးထားသော RHEL environment သို့ boot စတင်

### **Step 6 : Verifying the upgrade**

ယခု သင်သည် သင်၏ New RHEL System သို့ ချိတ်ဆက်ထားပြီး၊ အောက်ပါ command ဖြင့် အတည်ပြုပါ။

```plaintext
cat /etc/redhat-release
```

```plaintext
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
```

လိုအပ်သော Red Hat repositories များကို enabled လုပ်ထားကြောင်း စစ်ဆေးပါ။ ထို့အပြင်၊ Old CentOS repos များကို မရရှိနိုင်ကြောင်း သတိပြုပါ။

```plaintext
yum repolist
```

```plaintext
[root@centos ~]# yum repolist
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
Loading mirror speeds from cached hostfile
repo id                                                            repo name                                                                  status
convert2rhel-for-rhel-7-rpms                                       Convert2RHEL for OS 7                                                          10
rhel-7-server-rpms/7Server/x86_64                                  Red Hat Enterprise Linux 7 Server (RPMs)                                   33,833
repolist: 33,843
```

ယခု သင်သည် Conversion မှ Logs များကို ပြန်လည် review လုပ်နိုင်သည်။

```plaintext
less /var/log/convert2rhel/convert2rhel.log
```

```plaintext
# less /var/log/convert2rhel/convert2rhel.log

[07/22/2022 17:55:00] TASK - [Prepare: Show Red Hat software EULA] ******************************
The following text is a copy of the November 18, 2019 version of Red Hat GPLv2-Based End User License Agreement (EULA) [1].
For up-to-date version of the EULA, visit [2].
[1] https://www.redhat.com/licenses/Red_Hat_GPLv2-Based_EULA_20191118.pdf
[2] https://www.redhat.com/en/about/agreements

... output truncated ...
```

Tag - `#Linux`, `#RHEL`, `#CentOS`, `#Migration`

My Linkedin Profile - [https://www.linkedin.com/in/kyaw-thet-htun/](https://www.linkedin.com/in/kyaw-thet-htun/)

### **Thank You For Watching**
