Migrate from local repository

Hi,

I have a internal CentOS8 server (A) (disengage from internet).
I want to migrate to Almalinux.

I try to build local repository of AlmaLinux on my gateway server(B), but storage space is less than 200GB free for another local repository of AlmaLinux because this storage has CentOS8 repository.

(B) server is running on CentOS8, and it will migrate to AlmaLinux soon.

Can I create/sync repository of AlmaLinux (less than 200GB storage)?
Can I migrate CentOS8 to AlmaLinux with local repository ?

Thanks.

Just a quick thought here: why do you need the CentOS8 repository on server B? It has 7 days left to live, and if you are going to migrate to Alma could you not just delete the local repo and use the space for an Alma one?

That, and 200G should be plenty:

[mirror_8.5]$ du -d1 -h
3.7G	./BaseOS
12G	./AppStream
9.4G	./PowerTools
724K	./extras
25G	.

Whether you can tell the convenient migration script to use a local mirror … I have no idea.

1 Like

Server A can’t access to internet. A local repository on server B is a dnf target of server A.
If the CentOS8 repository was fixed and It does not need for migration to AlmaLinux, I can delete repository on server B.

jlehtone,

Thank you for your repository information.

I’m afraid of migration of server A with local repository on server B with official migration script…

Thank you.

Look at jlehtone’s figures. The total Alma repository is 50GiB, you have got just under 200GiB free. Remember that you do not need to duplicate EPEL or any other third party repositories, they stay the same. I understand your caution (I’ve run air-gapped machines in the past) and so I would suggest:

  1. Create a new Alma repository using just the repos jlehtone mentions.
  2. You should still have over 100 GiB, so don’t panic!
  3. (pretty obviously - a full backup)
  4. Run the conversion script
  5. When you are happy with the situation, remove the old CentOS repos, but not the third party ones.

25GiB. The last line was total of the four subdirs.

Then again, the official mirrors probably have content in those subdirs that I don’t sync with:

MIRROR=<closest official mirror>
VERS=8.5
SOURCE=${MIRROR}/${VERS}
DEST=/site/mirrors/almalinux.org/${VERS}

for R in BaseOS AppStream PowerTools extras
do
  ${RSYNC} --exclude="SRPMS/" ${SOURCE}/${R}/x86_64/os/ ${DEST}/${R}/x86_64/os/
done

Doh! :blush: As he says!

MartinR, jlehtone,

Thanks a lot!

I understand an AlmaLinux local repository doesn’t use 200GiB that was written in AlmaLinux wiki.

sorry… another question,
server B (gateway / repository) has no permissions for outgoing rsync protocol.
(It’s my fault of firewall configurations, and that is managed by upper authorities…)

Is it possible to set ‘reposync’ to ${RSYNC} ?
Does ‘reposync’ need yum.repos.d information ? It should be used after migration of server B ?

I’ve never used reposync. (The sync job was running on CentOS 6 until last year. Did that even have reposync?)

I do use RSYNC="/usr/bin/rsync -aqH --no-g --no-o --delete --delay-updates --bwlimit=1024"
and connect to a mirror that has rsync server.

How does your server B sync the CentOS8 repos? With reposync?

If one can’t prune what reposync pulls in and can’t use rsync protocol, then how about curl, wget, or lftp? The ftp can definitely “mirror” a tree and the others can use https/http.

After all, you do need just enough of repo content to migrate. Once done, you can free space by removing the CentOS repo mirror and start mirroring Alma repos “your normal way”.

[EDIT] One more thing …
Your A has connection to B and B has connection to outside. Is it possible for B to act as proxy? Particularly, if the migration script wants to talk to official Alma repos, then a proxy might solve that dilemma.

jlehtone,

My sync script is follows.

VER='8'
ARCH='x86_64'
REPOS=(baseos appstream extras epel)

for REPO in ${REPOS[@]}
do
    sudo -u apache reposync -q -p /data/repos/centos/${VER}/${ARCH}/os/ --repo=${REPO} --download-metadata --newest-only
done

reposync has to use http/https.

server B must not perform as proxy.
After server B migration and sync Alma repos, I try to write Alma hosts in server A host file and run it.