RLC Migration Guide¶
This guide covers various migration scenarios to Rocky Linux from CIQ (RLC) from different Linux distributions and environments.
Migration Overview¶
Supported Migration Paths¶
- Community Rocky Linux → RLC
- CentOS 7/8 → RLC
- RHEL 7/8/9 → RLC
- Oracle Linux → RLC
- AlmaLinux → RLC
- Physical to Virtual (P2V)
- Cloud Migrations
Pre-Migration Planning¶
# System assessment script
cat > /tmp/pre-migration-check.sh << 'EOF'
#!/bin/bash
echo "=== System Information ==="
cat /etc/os-release
uname -a
echo
echo "=== Hardware Information ==="
lscpu | grep -E "(CPU|Architecture|Model)"
free -h
df -h
echo
echo "=== Installed Packages ==="
rpm -qa | wc -l
echo "Total packages installed"
echo
echo "=== Custom Repositories ==="
dnf repolist
echo
echo "=== Running Services ==="
systemctl --type=service --state=running
echo
echo "=== Network Configuration ==="
ip addr show
ip route show
echo
echo "=== Storage Configuration ==="
lsblk
cat /etc/fstab
EOF
chmod +x /tmp/pre-migration-check.sh
/tmp/pre-migration-check.sh > /tmp/system-inventory.txt
Migration from Community Rocky Linux¶
Repository Migration¶
# Backup current configuration
sudo cp -r /etc/yum.repos.d /etc/yum.repos.d.backup
# Add RLC repositories
sudo cat > /etc/yum.repos.d/rlc.repo << 'EOF'
[rlc-baseos]
name=Rocky Linux from CIQ - BaseOS
baseurl=https://depot.ciq.com/rlc/baseos/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://depot.ciq.com/keys/RPM-GPG-KEY-CIQ
[rlc-appstream]
name=Rocky Linux from CIQ - AppStream
baseurl=https://depot.ciq.com/rlc/appstream/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://depot.ciq.com/keys/RPM-GPG-KEY-CIQ
[rlc-extras]
name=Rocky Linux from CIQ - Extras
baseurl=https://depot.ciq.com/rlc/extras/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://depot.ciq.com/keys/RPM-GPG-KEY-CIQ
EOF
# Configure authentication
echo "machine depot.ciq.com login YOUR_USERNAME password YOUR_TOKEN" > ~/.netrc
chmod 600 ~/.netrc
# Disable community repositories
sudo dnf config-manager --disable rocky-baseos rocky-appstream rocky-extras
# Update system
sudo dnf clean all
sudo dnf makecache
sudo dnf distro-sync
Verification¶
# Verify migration
dnf repolist enabled | grep -i ciq
rpm -q rocky-release
dnf history | head -10
Migration from CentOS 7¶
Pre-Migration Backup¶
# Create full system backup
sudo rsync -aAXv / --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /backup/centos7-backup/
# Export package list
rpm -qa > /tmp/centos7-packages.txt
# Backup configuration files
tar czf /tmp/centos7-configs.tar.gz /etc
Migration Process¶
# Install migration tool
sudo yum install -y curl
# Download conversion script
curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
chmod +x migrate2rocky.sh
# Run migration (this converts to Rocky Linux)
sudo ./migrate2rocky.sh -r
# After reboot, convert to RLC
# Follow the "Migration from Community Rocky Linux" steps above
Post-Migration Tasks¶
# Update to latest packages
sudo dnf update
# Check for orphaned packages
dnf list extras
# Verify services
systemctl --failed
systemctl list-unit-files --state=enabled
Migration from RHEL¶
License Considerations¶
# Remove RHEL-specific packages
sudo dnf remove subscription-manager rhn-setup
# Remove RHEL repositories
sudo rm -f /etc/yum.repos.d/redhat.repo
# Clean package manager cache
sudo dnf clean all
Repository Replacement¶
# Add RLC repositories
sudo dnf install https://depot.ciq.com/rlc/rlc-release-latest.rpm
# Configure authentication
sudo cat > /etc/yum/vars/ciq_username << 'EOF'
YOUR_USERNAME
EOF
sudo cat > /etc/yum/vars/ciq_token << 'EOF'
YOUR_TOKEN
EOF
sudo chmod 600 /etc/yum/vars/ciq_*
# Perform distribution sync
sudo dnf distro-sync
Application Migration¶
Service Migration¶
# Identify custom services
systemctl list-unit-files --type=service | grep -v 'systemd\|dbus'
# Export service configurations
mkdir -p /tmp/service-backup
cp /etc/systemd/system/*.service /tmp/service-backup/ 2>/dev/null || true
cp /usr/lib/systemd/system/*.service /tmp/service-backup/ 2>/dev/null || true
Database Migration¶
# MySQL/MariaDB backup
mysqldump --all-databases > /tmp/mysql-backup.sql
# PostgreSQL backup
pg_dumpall > /tmp/postgresql-backup.sql
# Copy database files
sudo systemctl stop mariadb postgresql
sudo cp -r /var/lib/mysql /tmp/mysql-data-backup
sudo cp -r /var/lib/pgsql /tmp/postgresql-data-backup
Web Server Migration¶
# Apache configuration backup
sudo cp -r /etc/httpd /tmp/httpd-backup
# Nginx configuration backup
sudo cp -r /etc/nginx /tmp/nginx-backup
# Web content backup
sudo tar czf /tmp/web-content.tar.gz /var/www
Cloud Migration¶
AWS Migration¶
# Create AMI from existing instance
aws ec2 create-image --instance-id i-1234567890abcdef0 --name "pre-migration-backup"
# Launch RLC instance from marketplace
aws ec2 run-instances --image-id ami-rlc-marketplace-id --instance-type t3.medium
# Transfer data using rsync
rsync -avz -e "ssh -i key.pem" /data/ ec2-user@new-instance:/data/
Azure Migration¶
# Create snapshot of existing VM
az snapshot create --resource-group myRG --source myVM --name pre-migration-snapshot
# Deploy RLC from marketplace
az vm create --resource-group myRG --name new-rlc-vm --image RLC-marketplace-image
# Migrate data
scp -r /data/ admin@new-vm:/data/
Google Cloud Migration¶
# Create machine image
gcloud compute machine-images create pre-migration-backup --source-instance=existing-vm
# Create RLC instance
gcloud compute instances create rlc-instance --image-family=rlc-family --image-project=ciq-project
# Transfer data
gsutil -m cp -r /data/ gs://migration-bucket/
Network Migration¶
IP Address Migration¶
# Document current network configuration
ip addr show > /tmp/network-config.txt
ip route show >> /tmp/network-config.txt
# Configure static IP on new system
sudo nmcli con mod "System eth0" ipv4.addresses 192.168.1.100/24
sudo nmcli con mod "System eth0" ipv4.gateway 192.168.1.1
sudo nmcli con mod "System eth0" ipv4.dns 8.8.8.8,8.8.4.4
sudo nmcli con mod "System eth0" ipv4.method manual
sudo nmcli con up "System eth0"
DNS and Load Balancer Updates¶
# Update DNS records (example using AWS Route 53)
aws route53 change-resource-record-sets --hosted-zone-id Z123456789 --change-batch file://dns-change.json
# Update load balancer targets
aws elbv2 register-targets --target-group-arn arn:aws:elasticloadbalancing:region:account:targetgroup/my-targets/1234567890123456 --targets Id=i-newinstance
Data Migration¶
File System Migration¶
# Create migration script
cat > /tmp/data-migration.sh << 'EOF'
#!/bin/bash
SOURCE_HOST="old-server"
DEST_HOST="new-rlc-server"
# Migrate user data
rsync -avz --progress /home/ root@$DEST_HOST:/home/
# Migrate application data
rsync -avz --progress /opt/ root@$DEST_HOST:/opt/
# Migrate logs (selective)
rsync -avz --progress /var/log/application/ root@$DEST_HOST:/var/log/application/
# Migrate database files
rsync -avz --progress /var/lib/mysql/ root@$DEST_HOST:/var/lib/mysql/
EOF
chmod +x /tmp/data-migration.sh
Configuration Migration¶
# Migrate system configurations
sudo rsync -avz /etc/passwd /etc/group /etc/shadow /etc/gshadow new-server:/tmp/
sudo rsync -avz /etc/ssh/ new-server:/etc/ssh/
sudo rsync -avz /etc/crontab /etc/cron.d/ new-server:/tmp/
# Migrate application configurations
sudo rsync -avz /etc/httpd/ new-server:/etc/httpd/
sudo rsync -avz /etc/nginx/ new-server:/etc/nginx/
sudo rsync -avz /etc/php.ini new-server:/etc/
Testing and Validation¶
Migration Testing¶
# Create test script
cat > /tmp/migration-test.sh << 'EOF'
#!/bin/bash
echo "=== Testing Migration ==="
echo "1. System Information"
cat /etc/os-release
echo "2. Package Count"
rpm -qa | wc -l
echo "3. Service Status"
systemctl --failed
echo "4. Network Connectivity"
ping -c 3 google.com
echo "5. Disk Usage"
df -h
echo "6. Memory Usage"
free -h
echo "7. Application Test"
# Add application-specific tests here
curl -I http://localhost/
echo "8. Database Test"
mysql -e "SHOW DATABASES;" 2>/dev/null || echo "MySQL not running"
echo "=== Migration Test Complete ==="
EOF
chmod +x /tmp/migration-test.sh
/tmp/migration-test.sh
Performance Comparison¶
# Benchmark script
cat > /tmp/performance-test.sh << 'EOF'
#!/bin/bash
echo "=== Performance Benchmark ==="
echo "CPU Test:"
time yes > /dev/null &
sleep 10
kill $!
echo "Memory Test:"
free -h
echo "Disk I/O Test:"
dd if=/dev/zero of=/tmp/testfile bs=1G count=1 oflag=direct
echo "Network Test:"
wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip
rm -f /tmp/testfile
EOF
chmod +x /tmp/performance-test.sh
Rollback Procedures¶
Rollback Planning¶
# Create rollback script
cat > /tmp/rollback-plan.sh << 'EOF'
#!/bin/bash
echo "=== ROLLBACK PROCEDURE ==="
echo "1. Stop services"
sudo systemctl stop httpd mariadb
echo "2. Restore from backup"
sudo rsync -avz /backup/original-system/ /
echo "3. Restore repository configuration"
sudo cp -r /etc/yum.repos.d.backup/* /etc/yum.repos.d/
echo "4. Restart services"
sudo systemctl start httpd mariadb
echo "5. Verify rollback"
cat /etc/os-release
systemctl status httpd mariadb
echo "=== ROLLBACK COMPLETE ==="
EOF
chmod +x /tmp/rollback-plan.sh
Post-Migration Tasks¶
Security Hardening¶
# Apply security configurations
sudo dnf update
sudo systemctl enable firewalld
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload
# Configure monitoring
sudo dnf install rsyslog logrotate
sudo systemctl enable rsyslog
Documentation Update¶
# Create migration report
cat > /tmp/migration-report.txt << 'EOF'
Migration Report
================
Date: $(date)
Source System: [Original OS and version]
Target System: Rocky Linux from CIQ
Migration Method: [Method used]
Pre-Migration:
- System inventory completed
- Backup created
- Dependencies identified
Migration Process:
- [Step-by-step process followed]
- [Any issues encountered]
- [Resolutions applied]
Post-Migration:
- All services operational
- Performance baseline established
- Security configurations applied
Next Steps:
- Monitor system for 48 hours
- Update documentation
- Train staff on new system
EOF
Troubleshooting Migration Issues¶
Common Problems¶
Package Conflicts:
# Resolve package conflicts
sudo dnf check
sudo dnf distro-sync --allowerasing
Service Failures:
# Check service dependencies
systemctl list-dependencies service-name
journalctl -u service-name
Repository Issues:
# Clear repository cache
sudo dnf clean all
sudo dnf makecache
# Check repository connectivity
curl -I https://depot.ciq.com
Next Steps¶
After successful migration:
- Configuration Guide - Optimize the new system
- Security Guide - Implement security hardening
For ongoing support:
- Troubleshooting Guide - Common issues and solutions
- FAQ - Frequently asked questions