- Implement directory integrity checks to detect missing CyberPanel components
- Add automatic recovery by cloning fresh repository when essential directories are lost
- Create database credential recovery with automatic password reset capability
- Update all service configurations (FTP, PowerDNS, Postfix, Dovecot) when password is reset
- Add service restart functionality to apply new configurations
- Preserve existing configuration files during recovery process
- Handle both Ubuntu (root password) and CentOS (separate password) database configurations
This ensures upgrades can complete successfully even when /usr/local/CyberCP is completely lost.
- Applied same fix from cyberpanel.sh to cyberpanel_upgrade.sh
- Detects AlmaLinux/Rocky Linux 9 (as CentOS 9) and uses dynamic Python path resolution
- Fixes TypeError: expected string or bytes-like object during virtualenv creation
- Uses 'which python3' to find correct Python executable path instead of hardcoded /usr/bin/python3
- Applied fix to all 4 locations where virtualenv is created in upgrade script