centos2ol icon indicating copy to clipboard operation
centos2ol copied to clipboard

How to switch CentOS to Oracle Linux with local yum repository (NO ISP).

Open petrjonak1 opened this issue 4 years ago • 14 comments

Some idea how to do it ?

petrjonak1 avatar Jun 23 '21 13:06 petrjonak1

At a high level and assuming you're migrating from CentOS 8 to Oracle Linux 8:,

You then need to add some logic after the initial switch is finished to fix all the repo URLs again because the ones you set above will be replaced by the switch process. You need to do this before the script calls yum distro-sync.

Djelibeybi avatar Jun 29 '21 22:06 Djelibeybi

Hi,

I am trying to convert a C7 server to OEL7 using my local repository.

Even with yum_url set to my mirror and repo_file set with my local details - the script still looks for the internet repos at this point:

  • echo 'Installing base packages for Oracle Linux...Installing base packages for Oracle Linux...
  • yum shell -y https://yum.oracle.com/repo/OracleLinux/OL7/UEKR6/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: yum.oracle.com; Name or service not known" Trying other mirror.

One of the configured repositories failed (Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 7Server (x86_64)),

I can't at all see where I need to 'fix all the repo URLs again because the ones you set above will be replaced by the switch process' - exactly where does it make the switch?

Thanks to any responses.

klokanovic avatar Nov 17 '22 04:11 klokanovic

It would probably be easier just to use your local DNS server (or /etc/hosts file if that's not possible) to resolve yum.oracle.com to your local mirror instead, to be honest.

Djelibeybi avatar Nov 17 '22 04:11 Djelibeybi

how should I know which packages i should add to my local repo? in order to support all the packages that need to be installed in the migration process? @Djelibeybi

talsh5528 avatar Jul 23 '23 13:07 talsh5528

The simplest solution is just to mirror all the packages using either uln-yum-mirror (available in the ol7_addons or ol8_addons repo) or my container-based solution which can run on any host that has Docker or Podman installed (including Windows or macOS using Docker Desktop): https://github.com/djelibeybi/oraclelinux-reposync

Djelibeybi avatar Jul 23 '23 14:07 Djelibeybi

thanks for the fast answer, and if I want to continue the process of line and migrate from Oracle 7 to Oracle 8 using Leapp command, there is also a nice solution?

From: Avi Miller @.> Date: Sunday, 23 July 2023 at 17:14 To: oracle/centos2ol @.> Cc: Tal Shechanovitz @.>, Comment @.> Subject: Re: [oracle/centos2ol] How to switch CentOS to Oracle Linux with local yum repository (NO ISP). (#83)

The simplest solution is just to mirror all the packages using either uln-yum-mirror (available in the ol7_addons or ol8_addons repo) or my container-based solution which can run on any host that has Docker or Podman installed (including Windows or macOS using Docker Desktop): https://github.com/djelibeybi/oraclelinux-reposync

— Reply to this email directly, view it on GitHubhttps://github.com/oracle/centos2ol/issues/83#issuecomment-1646850692, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A4FVKRRPBD7OLSHMZLMKEU3XRUWSVANCNFSM47F24SGQ. You are receiving this because you commented.Message ID: @.***>

talsh5528 avatar Jul 23 '23 14:07 talsh5528

You would need complete mirrors of both the Oracle Linux 7 and Oracle Linux 8 repos, as documented: https://docs.oracle.com/en/operating-systems/oracle-linux/8/leapp/leapp-AboutLeapp.html#upgrade-cond

Djelibeybi avatar Jul 23 '23 14:07 Djelibeybi

when mirroring all Oracle Linux 8 BaseOS Latest, Oracle Linux 8 AppStream Latest, and Oracle Linux 8 Leapp repositories packages by this command: reposync --repoid=ol8_appstream_latest --newest-only into my offline env, how much space do I need for this offline migration from oracle7 to oracle8?
maybe there is an option to mirror specific packages? instead of the the all repositories? @Djelibeybi

talsh5528 avatar Jul 24 '23 11:07 talsh5528

For Leapp to work, you need to mirror the entire repository, otherwise it's liable to fail to upgrade and you'll be left with broken instances. To find the current size of the repos, run yum repolist -v on the OL8 machine. Looks like ol8_baseos_latest is 46GB and ol8_appstream is 374GB.

Djelibeybi avatar Jul 24 '23 12:07 Djelibeybi

so there is another way to migrate the oracle7 machine to oracle8 in offline env? without saving 400GB +? more I tried to migrate with my local repo after mirroring only the newest version of each package, but the leapp command failed: 1. Inhibitor: Some required custom target repositories have not been found Consult the pre-upgrade report for details and possible remediation. @Djelibeybi

talsh5528 avatar Jul 24 '23 13:07 talsh5528

No, there isn't. Switching from CentOS 7 to Oracle Linux 7 then upgrading to Oracle Linux 8 is very, very tricky. You're probably better off just installing a new Oracle Linux 8 instance offline and moving your application manually.

Djelibeybi avatar Jul 24 '23 14:07 Djelibeybi

Djelibeybi i have jest finished cloning all packages from ol8_baseos_latest and ol8_appstream(the newest version), and I have my local repo, but it looks like the leapp upgrade don't recognize my repo, even when I am using this command sudo leapp preupgrade --oraclelinux --enablerepo=ol8_baseos_local I get the error I mentioned earlier: image there is some way to handle that?

talsh5528 avatar Jul 24 '23 14:07 talsh5528

This isn't the right place for Leapp support. I suggest you review the Upgrade documentation very carefully and check the logs to determine what's missing. The preflight checks should guide you to the right answer. Otherwise, you might need to use Oracle Support.

Djelibeybi avatar Jul 24 '23 14:07 Djelibeybi