Automated scripts for upgrading Proxmox Virtual Environment between major versions with comprehensive safety checks and error handling.
THIS SCRIPT PERFORMS MAJOR SYSTEM MODIFICATIONS THAT CAN RENDER YOUR SYSTEM UNBOOTABLE OR CAUSE DATA LOSS.
- NOT RESPONSIBLE FOR ANY DATA LOSS, SYSTEM DAMAGE, OR DOWNTIME
- NO WARRANTY PROVIDED - USE ENTIRELY AT YOUR OWN RISK
- ALWAYS TEST IN DEVELOPMENT ENVIRONMENT FIRST
- NEVER RUN ON PRODUCTION WITHOUT EXTENSIVE TESTING
- ENSURE COMPLETE BACKUPS BEFORE PROCEEDING
Before using this script on ANY production system:
- Set up an identical test environment
- Run the script on test systems multiple times
- Verify all your VMs and containers work post-upgrade
- Document any issues and solutions
- Only then consider using on production with proper maintenance windows
This repository contains automated upgrade scripts for Proxmox Virtual Environment (PVE) that help transition between major versions while maintaining system integrity and minimizing downtime.
proxmox-8to9-upgrade.sh- Upgrades Proxmox VE 8.x to 9.x (Debian Bookworm β Trixie)
- π Pre-flight System Checks - Network, disk space, dependencies
- π‘οΈ Safety Mechanisms - Multiple confirmation prompts and backup reminders
- π Comprehensive Logging - Detailed progress tracking and error reporting
- π§ Automatic Repository Management - Handles Debian and Proxmox repository transitions
- πΎ Configuration Backup - Automatic backup of critical configurations
- π₯οΈ UEFI/BIOS Support - Handles both boot methods and fixes common issues
- π Kernel Management - Ensures proper kernel installation and boot configuration
- β Post-Upgrade Verification - Validates successful upgrade completion
- π± Cluster Awareness - Detects and provides guidance for cluster environments
- π¨ Error Recovery - Comprehensive error handling with recovery guidance
- Proxmox VE 8.x installation (8.4.x recommended)
- Root access to the system
- Stable internet connection
- At least 5GB free disk space
- Console access (IPMI/iLO recommended for production)
-
Complete System Backup
# Backup all VMs and containers vzdump --all --storage <backup-storage> --mode snapshot # Backup configuration tar -czf /tmp/pve-config-backup.tar.gz /etc/pve/ /etc/network/interfaces /etc/hosts
-
Update to Latest PVE 8.4.x
apt update && apt dist-upgrade pveversion # Should show 8.4.x
-
Ceph Users (if applicable)
# Upgrade Ceph to Squid before PVE upgrade # Follow: https://pve.proxmox.com/wiki/Ceph_Reef_to_Squid
# Download the script
wget https://raw.githubusercontent.com/YOUR-USERNAME/proxmox-upgrade-scripts/main/scripts/proxmox-8to9-upgrade.sh
# Make executable
chmod +x proxmox-8to9-upgrade.sh
# Verify download integrity (optional but recommended)
sha256sum proxmox-8to9-upgrade.shgit clone https://github.com/YOUR-USERNAME/proxmox-upgrade-scripts.git
cd proxmox-upgrade-scripts/scripts
chmod +x proxmox-8to9-upgrade.sh# Run directly for testing
./proxmox-8to9-upgrade.shALWAYS use tmux or screen to prevent SSH disconnection issues:
# Start tmux session
tmux new-session -d -s pve-upgrade
# Attach to session
tmux attach-session -t pve-upgrade
# Run the upgrade script
./proxmox-8to9-upgrade.sh
# If disconnected, reconnect with:
# tmux attach-session -t pve-upgradeUpgrade nodes ONE AT A TIME:
# Node 1: Run upgrade, wait for completion and verification
./proxmox-8to9-upgrade.sh
# Wait for node to be fully operational
# Verify cluster status: pvecm status
# Only then proceed to Node 2, then Node 3, etc.After the script completes, verify your system:
# Check versions
uname -r # Should show 6.14.x-pve kernel
pveversion # Should show 9.x.x
# Check services
systemctl status pve-cluster pvedaemon pveproxy
# Clear browser cache and test web interface
# Press Ctrl+Shift+R in browser
# Test VMs and containers
qm list # List VMs
pct list # List containers
# Start any stopped VMs/containers
qm start <vmid>
pct start <ctid>
# Check logs for issues
journalctl -xe# Fix UEFI boot problems
echo 'grub-efi-amd64 grub2/force_efi_extra_removable boolean true' | debconf-set-selections -v
apt install --reinstall grub-efi-amd64# Check available kernels
ls /boot/vmlinuz-*
# Ensure GRUB is updated
update-grub
# Reboot if new kernel available
reboot# Restart PVE services
systemctl restart pve-cluster pvedaemon pveproxy
# Check cluster status (if applicable)
pvecm status# Fix broken packages
apt --fix-broken install
# Complete interrupted upgrade
apt dist-upgradeIf the upgrade fails:
-
Check current status:
pveversion systemctl status pve-cluster pvedaemon pveproxy
-
Attempt to complete upgrade:
apt update apt dist-upgrade
-
If system is broken:
- Boot from rescue media
- Restore from backups
- Contact Proxmox support if you have a subscription
- Official Proxmox VE 8 to 9 Upgrade Guide
- Proxmox VE Documentation
- Proxmox Community Forum
- Debian Trixie Release Notes
Contributions are welcome! Please follow these guidelines:
- Test thoroughly in lab environments
- Document changes clearly
- Follow bash best practices
- Include error handling
- Update documentation as needed
# Fork the repository
# Create feature branch
git checkout -b feature/improvement-name
# Make changes and test extensively
# Commit with clear messages
git commit -m "feat: add improved error handling for X"
# Push and create pull request
git push origin feature/improvement-nameThis project is licensed under the MIT License - see the LICENSE file for details.
- I have read and understood all disclaimers
- I have complete, tested backups of all data
- I have tested this script in a development environment
- I have a maintenance window scheduled
- I have console access to the server
- I understand the risks of major system upgrades
- I accept full responsibility for any consequences
- Proxmox Support: (If you have a subscription)
- Your System Administrator
- Your Backup/Disaster Recovery Team
- Based on official Proxmox VE upgrade documentation
- Inspired by community feedback and real-world usage
- Special thanks to the Proxmox development team
Remember: When in doubt, don't upgrade. A working Proxmox VE 8.x system is better than a broken Proxmox VE 9.x system.
| Script Version | Proxmox VE Source | Proxmox VE Target | Debian Source | Debian Target | Status |
|---|---|---|---|---|---|
| 1.0.0 | 8.4.x | 9.0.x | Bookworm | Trixie | β Stable |
Last updated: $(date +'%Y-%m-%d')