Understanding the Differences
Ubuntu and Debian share the same package management system (apt/dpkg) and many configuration patterns, but have key differences in default packages, release cycles, and system configuration. Migration typically involves setting up a new server rather than in-place conversion.
Key Differences
| Feature | Ubuntu | Debian |
|---|---|---|
| Release cycle | 6 months (LTS: 2 years) | ~2 years |
| Support length | LTS: 5 years | ~3 years + LTS |
| Default init | systemd | systemd |
| Packages | Newer, more PPAs | Stable, conservative |
| Firewall | ufw (pre-installed) | nftables/iptables |
Migration Approach: Parallel Setup
# 1. Deploy new server with target OS
# 2. Install equivalent packages
# 3. Transfer configurations
# 4. Transfer data
# 5. DNS cutover
# Export installed packages from source
dpkg --get-selections | grep -v deinstall | awk '{print $1}' > packages.txt
# On destination, install matching packages (skip OS-specific ones)
cat packages.txt | xargs sudo apt install -y 2>&1 | tee install.log
Configuration Transfer
# Key config directories to sync:
rsync -avz root@source:/etc/nginx/ /etc/nginx/
rsync -avz root@source:/etc/php/ /etc/php/
rsync -avz root@source:/etc/mysql/ /etc/mysql/
# Ubuntu-specific adjustments for Debian:
# - Remove PPA repositories (not available on Debian)
# - Replace snap packages with apt or manual installs
# - Adjust firewall (ufw may need installation on Debian)
sudo apt install -y ufw
Data Transfer
# Website files
rsync -avz root@source:/var/www/ /var/www/
# Databases
ssh root@source "mysqldump --all-databases --single-transaction" | mysql
# Home directories
rsync -avz root@source:/home/ /home/
# Cron jobs
ssh root@source "crontab -l" | crontab -
Best Practices
- Set up new server in parallel, never attempt in-place distribution change
- Test all services on the new server before DNS cutover
- Pay attention to PHP version differences between distributions
- Check that all required packages are available in the target distribution
- Verify systemd service files are compatible