{"id":4140,"date":"2022-05-26T23:53:38","date_gmt":"2022-05-27T06:53:38","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=4140"},"modified":"2022-05-26T23:53:42","modified_gmt":"2022-05-27T06:53:42","slug":"how-to-migrate-from-centos-8-to-centos-stream","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=4140","title":{"rendered":"How to Migrate from CentOS 8 to CentOS Stream"},"content":{"rendered":"\n<p>Author:&nbsp;Vivek Gite&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1 \u2013 Backup<\/h2>\n\n\n\n<p>Like every seasoned developer and sysadmin, I backed up all my project files, MySQL database and config files. So if something goes wrong, I should be able to go back quickly. That is all. Hence, keep verified backups. I have following software installed:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.cyberciti.biz\/faq\/how-to-enable-and-install-epel-repo-on-centos-8-x\/\">ELEP repo enabled for CentOS 8<\/a><\/li><li>SELinux and&nbsp;<a href=\"https:\/\/www.cyberciti.biz\/faq\/how-to-set-up-a-firewall-using-firewalld-on-centos-8\/\">FirewallD on CentOS 8&nbsp;<\/a>enabled<\/li><li>Python 3.6.8.<\/li><li>python3-mod_wsgi.<\/li><li>Perl 5.26.3.<\/li><li>mod_perl 2.0.11-4.<\/li><li>Apache (httpd) 2.4.37 with mod_ssl, mod_security, mod_session, mod_speedycgi and other modules.<\/li><\/ul>\n\n\n\n<p>Do note down and list enabled repos:<br><code># yum repolist<br># yum repolist enabled &gt; \/root\/pre.update.dnf.repo.txt<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2 \u2013 Installing all updates on CentOS 8<\/h2>\n\n\n\n<p>Login using the ssh command:<br><code>ssh {userName}@{your-Server-Name-IP-Here}<br># for example:<br>ssh vivek@nixcraft-centos-httpd<\/code><br>Next, simply run the dnf command:<br><code>sudo dnf update<\/code><br>Then&nbsp;<a href=\"https:\/\/www.cyberciti.biz\/faq\/howto-reboot-linux\/\">reboot the Linux box<\/a>&nbsp;using the&nbsp;<a href=\"https:\/\/www.cyberciti.biz\/faq\/howto-shutdown-linux\/?utm_source=Linux_Unix_Command&amp;utm_medium=cms&amp;utm_campaign=nixcmd\">shutdown command<\/a>&nbsp;or&nbsp;<a href=\"https:\/\/www.cyberciti.biz\/faq\/linux-reboot-command\/?utm_source=Linux_Unix_Command&amp;utm_medium=cms&amp;utm_campaign=nixcmd\">reboot command<\/a>:<br><code>sudo shutdown -r now<\/code><br>Let us verify CentOS Linux 8 version using the&nbsp;<a href=\"https:\/\/www.cyberciti.biz\/faq\/linux-unix-appleosx-bsd-cat-command-examples\/?utm_source=Linux_Unix_Command&amp;utm_medium=cms&amp;utm_campaign=nixcmd\">cat command<\/a>\/<a href=\"https:\/\/bash.cyberciti.biz\/guide\/More_command?utm_source=Linux_Unix_Command&amp;utm_medium=cms&amp;utm_campaign=nixcmd\">more command<\/a>&nbsp;or&nbsp;<a href=\"https:\/\/bash.cyberciti.biz\/guide\/Less_command?utm_source=Linux_Unix_Command&amp;utm_medium=cms&amp;utm_campaign=nixcmd\">less command<\/a>:<br><code>more \/etc\/centos-release<\/code><br><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/www.cyberciti.biz\/media\/new\/cms\/2021\/12\/Migrate-from-CentOS-8-to-CentOS-Stream-Verification.png\" alt=\"Migrate from CentOS 8 to CentOS Stream Verification\" width=\"599\" height=\"485\"><\/p>\n\n\n\n<p id=\"caption-attachment-1891\">My fully patched CentOS 8 stable ready for migration to CentOS Stream<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3 \u2013 Installing CentOS Stream package<\/h2>\n\n\n\n<p>Let us install the CentOS-Stream release file by typing the following dnf command:<br><code>sudo dnf in centos-release-stream<\/code><br><img decoding=\"async\" src=\"https:\/\/www.cyberciti.biz\/media\/new\/cms\/2021\/12\/How-to-Migrate-CentOS-8-Installation-to-CentOS-Stream-Using-DNF.png\" alt=\"How to Migrate CentOS 8 Installation to CentOS Stream Using DNF\" width=\"599\" height=\"566\"><\/p>\n\n\n\n<p id=\"caption-attachment-1892\">Installing CentOS-Stream release files<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4 \u2013 Migrating From CentOS 8 to CentOS Stream<\/h2>\n\n\n\n<p>Now we have the required package is in place. In other words, the dnf is ready to provide a simple way for us to start migrating from CentOS 8 to CentOS Stream. But, first, we must swap repos. The following command will remove CentOS 8 repo and replace it with the CentOS Stream repo. We will get all updates and libs\/apps from CentOS Stream. Execute the following command:<br><code>sudo dnf swap centos-linux-repos centos-stream-repos<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Last metadata expiration check: 0:07:46 ago on Friday 03 December 2021 05:14:03 PM UTC.\nDependencies resolved.\n<strong>========================================================================================<\/strong>\n Package                      Architecture  Version          Repository            Size\n<strong>=<\/strong>=======================================================================================\nInstalling:\n centos-stream-release        noarch        8.6-1.el8        Stream-BaseOS         22 k\n     replacing  centos-linux-release.noarch 8.5-1.2111.el8\n     replacing  centos-release-stream.x86_64 8.1-1.1911.0.7.el8\n centos-stream-repos          noarch        8-3.el8          extras                19 k\nRemoving:\n centos-linux-repos           noarch        8-3.el8          @baseos               26 k\n&nbsp;\nTransaction Summary\n<strong>=<\/strong>=======================================================================================\nInstall  2 Packages\nRemove   1 Package\n&nbsp;\nTotal download size: 42 k\nIs this ok <strong>[y\/N]<\/strong>: y\nDownloading Packages:\n(1\/2): centos-stream-repos-8-3.el8.noarch.rpm           588 kB\/s |  19 kB     00:00    \n(2\/2): centos-stream-release-8.6-1.el8.noarch.rpm        61 kB\/s |  22 kB     00:00    \n----------------------------------------------------------------------------------------\nTotal                                                    91 kB\/s |  42 kB     00:00     \nRunning transaction check\nTransaction check succeeded.\nRunning transaction test\nTransaction test succeeded.\nRunning transaction\n  Preparing        :                                                                1\/1 \n  Running scriptlet: centos-stream-release-8.6-1.el8.noarch                         1\/1 \n  Installing       : centos-stream-release-8.6-1.el8.noarch                         1\/5 \n  Installing       : centos-stream-repos-8-3.el8.noarch                             2\/5 \n  Obsoleting       : centos-release-stream-8.1-1.1911.0.7.el8.x86_64                3\/5 \n  Obsoleting       : centos-linux-release-8.5-1.2111.el8.noarch                     4\/5 \n  Erasing          : centos-linux-repos-8-3.el8.noarch                              5\/5 \nwarning: \/etc\/yum.repos.d\/CentOS-Linux-PowerTools.repo saved as \/etc\/yum.repos.d\/CentOS-Linux-PowerTools.repo.rpmsave\nwarning: \/etc\/yum.repos.d\/CentOS-Linux-Plus.repo saved as \/etc\/yum.repos.d\/CentOS-Linux-Plus.repo.rpmsave\nwarning: \/etc\/yum.repos.d\/CentOS-Linux-HighAvailability.repo saved as \/etc\/yum.repos.d\/CentOS-Linux-HighAvailability.repo.rpmsave\nwarning: \/etc\/yum.repos.d\/CentOS-Linux-FastTrack.repo saved as \/etc\/yum.repos.d\/CentOS-Linux-FastTrack.repo.rpmsave\nwarning: \/etc\/yum.repos.d\/CentOS-Linux-Extras.repo saved as \/etc\/yum.repos.d\/CentOS-Linux-Extras.repo.rpmsave\nwarning: \/etc\/yum.repos.d\/CentOS-Linux-Devel.repo saved as \/etc\/yum.repos.d\/CentOS-Linux-Devel.repo.rpmsave\nwarning: \/etc\/yum.repos.d\/CentOS-Linux-ContinuousRelease.repo saved as \/etc\/yum.repos.d\/CentOS-Linux-ContinuousRelease.repo.rpmsave\nwarning: \/etc\/yum.repos.d\/CentOS-Linux-BaseOS.repo saved as \/etc\/yum.repos.d\/CentOS-Linux-BaseOS.repo.rpmsave\nwarning: \/etc\/yum.repos.d\/CentOS-Linux-AppStream.repo saved as \/etc\/yum.repos.d\/CentOS-Linux-AppStream.repo.rpmsave\n&nbsp;\n  Running scriptlet: centos-linux-repos-8-3.el8.noarch                              5\/5 \n  Verifying        : centos-stream-repos-8-3.el8.noarch                             1\/5 \n  Verifying        : centos-stream-release-8.6-1.el8.noarch                         2\/5 \n  Verifying        : centos-linux-release-8.5-1.2111.el8.noarch                     3\/5 \n  Verifying        : centos-release-stream-8.1-1.1911.0.7.el8.x86_64                4\/5 \n  Verifying        : centos-linux-repos-8-3.el8.noarch                              5\/5 \n&nbsp;\nInstalled:\n  centos-stream-release-8.6-1.el8.noarch       centos-stream-repos-8-3.el8.noarch      \nRemoved:\n  centos-linux-repos-8-3.el8.noarch                                                     \n&nbsp;\nComplete!<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Finally migrate CentOS 8 installation to CentOS stream<\/h3>\n\n\n\n<p>First list repos, run:<br><code>sudo dnf repolist<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Upgrading CentOS 8 to CentOS Stream<\/h4>\n\n\n\n<p>We are now close to our target. Next, we need to get packages for CentOS Stream&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Application_binary_interface\" rel=\"noreferrer noopener\" target=\"_blank\">ABI\/API<\/a>. This will upgrade or downgrade packages to match the new ABI\/API and break 100% RHEL compatibility due to ABI\/API change. I am OK with that. So let us do it:<br><code>sudo dnf distro-sync<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Last metadata expiration check: 0:00:19 ago on Friday 03 December 2021 05:28:32 PM UTC.\nDependencies resolved.\n<strong>========================================================================================<\/strong>\n Package                     Arch   Version                             Repo       Size\n<strong>=<\/strong>=======================================================================================\nUpgrading:\n NetworkManager              x86_64 1:1.36.0-0.1.el8                    baseos    2.3 M\n NetworkManager-libnm        x86_64 1:1.36.0-0.1.el8                    baseos    1.8 M\n NetworkManager-team         x86_64 1:1.36.0-0.1.el8                    baseos    149 k\n NetworkManager-tui          x86_64 1:1.36.0-0.1.el8                    baseos    341 k\n bash                        x86_64 4.4.20-3.el8                        baseos    1.5 M\n c-ares                      x86_64 1.13.0-6.el8                        baseos     93 k\n ca-certificates             noarch 2021.2.50-82.el8                    baseos    390 k\n cloud-init                  noarch 21.1-9.el8                          appstream 1.0 M\n cpio                        x86_64 2.12-11.el8                         baseos    266 k\n cronie                      x86_64 1.5.2-6.el8                         baseos    118 k\n cronie-anacron              x86_64 1.5.2-6.el8                         baseos     42 k\n crypto-policies             noarch 20211116-1.gitae470d6.el8           baseos     64 k\n crypto-policies-scripts     noarch 20211116-1.gitae470d6.el8           baseos     83 k\n device-mapper               x86_64 8:1.02.181-1.el8                    baseos    377 k\n device-mapper-libs          x86_64 8:1.02.181-1.el8                    baseos    409 k\n dnf                         noarch 4.7.0-5.el8                         baseos    543 k\n dnf-automatic               noarch 4.7.0-5.el8                         baseo\n.....\n..\n vim-enhanced                x86_64 2:8.0.1763-16.el8_5.2               appstream 1.4 M\n vim-filesystem              noarch 2:8.0.1763-16.el8_5.2               appstream  49 k\n vim-minimal                 x86_64 2:8.0.1763-16.el8_5.2               baseos    573 k\n yum                         noarch 4.7.0-5.el8                         baseos    206 k\nInstalling dependencies:\n glibc-gconv-extra           x86_64 2.28-170.el8                        baseos    1.4 M\nInstalling weak dependencies:\n sqlite                      x86_64 3.26.0-15.el8                       baseos    668 k\nDowngrading:\n unzip                       x86_64 6.0-45.el8                          baseos    195 k\n&nbsp;\nTransaction Summary\n<strong>=<\/strong>=======================================================================================\nInstall     2 Packages\nUpgrade    86 Packages\nDowngrade   1 Package\n&nbsp;\nTotal download size: 95 M\nDownloading Packages:\n(1\/89): unzip-6.0-45.el8.x86_64.rpm                     571 kB\/s | 195 kB     00:00    \n(2\/89): sqlite-3.26.0-15.el8.x86_64.rpm                 1.4 MB\/s | 668 kB     00:00    \n&nbsp;\n.....\n..\n  vim-filesystem-2:8.0.1763-16.el8_5.2.noarch                                           \n  vim-minimal-2:8.0.1763-16.el8_5.2.x86_64                                              \n  yum-4.7.0-5.el8.noarch                                                                \nDowngraded:\n  unzip-6.0-45.el8.x86_64                                                               \nInstalled:\n  glibc-gconv-extra-2.28-170.el8.x86_64           sqlite-3.26.0-15.el8.x86_64          \n&nbsp;\nComplete!<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5 \u2013 Reboot the system<\/h2>\n\n\n\n<p>Run:<br><code>sudo systemctl reboot<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6 \u2013 Verification<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.cyberciti.biz\/media\/new\/cms\/2021\/12\/Upgrading-CentOS-8-to-CentOS-Stream-Linux-using-DNF.png\" alt=\"Upgrading CentOS 8 to CentOS Stream Linux using DNF\" class=\"wp-image-1893\"\/><\/figure><\/div>\n\n\n\n<p>See&nbsp;<a href=\"https:\/\/www.cyberciti.biz\/faq\/how-to-check-os-version-in-linux-command-line\/\">CentOS stream version<\/a>&nbsp;for verification:<br><code>cat \/etc\/centos-release<\/code><br><br>Make sure there are no errors. Let us&nbsp;<a href=\"https:\/\/www.cyberciti.biz\/faq\/linux-log-files-location-and-how-do-i-view-logs-files\/\">see or view errors log on Linux<\/a>:<br><code>sudo tail -f \/var\/log\/messages<br>sudo grep -i -E 'err|wan|cri' \/var\/log\/messages<br>sudo grep -i -E 'err|wan|cri' \/var\/log\/nginx\/error.log<\/code><br><a href=\"https:\/\/www.cyberciti.biz\/faq\/how-to-check-open-ports-in-linux-using-the-cli\/\">List open ports on Linux<\/a>&nbsp;and make sure services such as httpd, mysqld and stuff is running using the systemctl command or netstat command\/ss command:<br><code>sudo ss -tulpn<br>systemctl status httpd<br>systemctl status mysqld<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">A note about 3rd party dnf repos<\/h3>\n\n\n\n<p>Some dnf repos may be renamed or disabled to prevent upgrade issues. It would be best if you validated those manually. For example:<br># yum repolist<br># yum repolist enabled &gt; \/root\/post.update.dnf.repo.txt<br>You can compare those two files:<br><code># cat \/root\/post.update.dnf.repo.txt<br># cat \/root\/pre.update.dnf.repo.txt<br># diff \/root\/pre.update.dnf.repo.txt \/root\/post.update.dnf.repo.txt<\/code><br>Then enable missing repos again.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Video demo<\/h2>\n\n\n\n<p>Here is a quick video demo:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.ytimg.com\/vi\/O2Eexp9SSSE\/hqdefault.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Summing up<\/h2>\n\n\n\n<p>I am pleasantly surprised by how smoothly the process went. This saved me time. I am also aware that one can take a similar approach to switch to AlmaLinux or RocyLinux, or Oracle Linux by swapping repos. For now, my side project working smoothly on AWS EC2 VM. But, one can use self-hosted or other cloud service providers too. I also deployed a local Rocky Linux VM on my Laptop, where I will containerize my app, so I no longer have to depend on the host OS. That is why I didn\u2019t waste much time with a completely new OS. Do check out the CentOS Stream&nbsp;<a href=\"https:\/\/www.centos.org\/centos-stream\/\" target=\"_blank\" rel=\"noreferrer noopener\">website for documentation<\/a>.<\/p>\n\n\n\n<p>Ref: https:\/\/www.cyberciti.biz\/howto\/upgrade-migrate-from-centos-8-to-centos-stream-conversion\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Author:&nbsp;Vivek Gite&nbsp; Step 1 \u2013 Backup Like every seasoned developer and sysadmin, I backed up all my project files, MySQL database and config files. So if something goes wrong, I should be able to go back quickly. That is all. Hence, keep verified backups. I have following software installed: ELEP repo enabled for CentOS 8 <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=4140\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[262,5],"tags":[1173,1172],"class_list":["post-4140","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","tag-migrate-centos-8-to-centos-stream","tag-migrate-from-centos-8-to-centos-stream"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4140"}],"version-history":[{"count":3,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4140\/revisions"}],"predecessor-version":[{"id":4143,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4140\/revisions\/4143"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}