CentOS8 to AlmaLinux8 Offline Migration

I have a CentOS 8.5 server that I wish to migrate but it is in an air gapped network. It has been patched to the latest 8.5 updates but I only see the migration script to get everything online. I did used rsync with a mirror to download everything AlmaLinux8 on an external drive which I used for all my Linux Servers but I cant seem to point the migration script to the local repository instead of the internet. Is there an offline migration tool, script that I can use to migrate this air gapped server using my usb drive?

Hi there! You should be able to follow this guide to get it upgraded. Let us know if you hit any problems! ELevate Offline Guide | AlmaLinux Wiki

So I downloaded both AlmaLinux8 and Elevate updates Repos and followed everything up to the “leapp preupgrade”. It tells me there’s an error for “scan_source_kernel” when I haven pointed it to everything AL8 repos (BaseOS/AppStream/extras/plus only). Is there something I’m missing? I could not follow everything to the letter because while it says “offline” it still wants to point to internet repos and I’m running everything form and external hdd, meaning all my repos point to “file:///<mount point of the updates/BaseOS/x86_64/… … …>”

My current kernel is 4.18.0-553.45.1-el8_10.x86_64 and i see under /var/log/leapp/leapp-preupgrade.log that its trying to update/upgrade something to almalinux9

I’m so sorry, I completely misguided you here. ELevate only works to get you between major versions. You should be able to use the almalinux-deploy script to migrate to AlmaLinux from CentOS 8.

I’ve asked in our documentation channel to see if we have documentation on how to accomplish what you’re asking - I feel like it did exist, but I can’t seem to find it.

Looks like we haven’t documented how to do that, but I opened an issue to see if we can get that added and/or documented:

I tried the deploy script on an internet connected system and it went through… havent tried on an offline system but with all the Repos mapped to an external drive. I will give it a shot but I would imagine I would have to map/point the script somewhere to my external drive so it does everything it needs to without going to the internet.

Thanks for the help in this.

The offline (non-connected) system did patch software and other stuff with the AlmaLinux8, EPEL and ELEVATE repos when using the “dnf update” command although it stayed as CentOS 8.5…

we’ve got a guide in draft! Update 'AlmaLinux Migration Guide' with how to migrate air-gapped machine by yuravk · Pull Request #602 · AlmaLinux/wiki · GitHub

1 Like

Thank you ma’am!! That will be helpful for a lot of systems that are completely offline.

The work in almalinux-deploy is complete and the guide has been merged into the wiki now!

1 Like

I downloaded the almalinux-deploy.sh script again and followed the new guidelines but its giving me the following errors by using the following command:

sudo bash almalinux-deploy.sh --local-repo=file:///opt
almalinux-deploy.sh: line 1: $‘\r’: command not found
almalinux-deploy.sh: line 3: $‘\r’: command not found
almalinux-deploy.sh: line 9: $‘\r’: command not found
: invalid option nameline 10: set: pipefail

Anything I might be missing? I checked those lines and they are empty lines…

Also…

I had my external HDD mounted to /opt and upon looking like:
/opt
8
—AppStream
—BaseOS
—extras
—plus
—PowerTools
—Resilient Storage
almalinux-release-latest-8.x86-64.rpm
RPM-GPG-KEY-AlmaLinux-8
almalinux-deploy.sh

If I mount it to the original location it auto-mounted it would look like:

AlmaLinux8_Updates
—AppStream
—BaseOS
—extras
—plus
—PowerTools
—Resilient Storage
almalinux-release-latest-8.x86-64.rpm
RPM-GPG-KEY-AlmaLinux-8
almalinux-deploy.sh

Do I have to change my dnf.conf file as well for this to work? Or install the release.rpm?

Could you please report:

  • MD5 sum for downloaded almalinux-deploy.sh script:
# md5sum almalinux-deploy.sh
1b71e174d54b0f42b172b44e547338b5  almalinux-deploy.sh
  • file information for the almalinux-deploy.sh:
# file almalinux-deploy.sh 
almalinux-deploy.sh: Bourne-Again shell script, ASCII text executable, with very long lines, with escape sequences
  • your default shell ?
# echo $SHELL

No changes to the dnf.conf and no additional packages installation required.

Hey there!

Md5 sum from github almalinux-deploy-master zip:

On PowerShell:

Get-filehash almalinux.sh

55ECE8F77C711B123453777517F767856CCC97344ADEEFE8DFE099358B223699

##############

Md5 sum from AlmaLinux Migration guide link:

On PowerShell:

Get-filehash almalinux.sh

55ECE8F77C711B123453777517F767856CCC97344ADEEFE8DFE099358B223699

On CentOS8 bash:

md5sum almalinux.sh

1604cf1356c6ef5513fd58c833a44e0d


# file almalinux-deploy.sh 
almalinux-deploy.sh: Bourne-Again shell script, ASCII text executable, with very long lines, with escape sequences

echo $SHELL /bin/bash

So, you are downloading the almalinux-deploy.sh on from under windows ?
That probably is the reason of your errors which caused by non unix line endings:

almalinux-deploy.sh: line 1: $‘\r’: command not found

Is that possible you do “Download ZIP” on Windows machine from GitHub - AlmaLinux/almalinux-deploy: EL to AlmaLinux migration tool. and put it on your external drive. After that reconnect the drive to CentOS8 machine, and unzip there:

unzip almalinux-deploy-master.zip

That is to make sure line endings are correct. The utility will be at almalinux-deploy-master/almalinux-deploy.sh

1 Like

Yes. We have to download everything from our connected systems, scan them and then transfer to out stand-alone environment.

I’ll try this and let you know what happens. Thanks for the support.

1 Like

I downloaded the almalinux-deploy-master.zip from the link and unzipped it on the CentOS8 VM but got the same hash as before. did the script file change? where can I get the one you have with the same hash as you get?

md5sum almalinux.sh
1604cf1356c6ef5513fd58c833a44e0d

Yes it was changed. Its checksum now is 1604cf1356c6ef5513fd58c833a44e0d