Automation Script: Upgrading Debian 11 to 12 and VitalPBX 4 to 4.5

This script automates the process of upgrading a Debian 11 system to Debian 12 and includes a seamless migration from VitalPBX 4 to VitalPBX 4.5, along with cleanup tasks to optimize the environment.

Before upgrading your system, it is strongly recommended that you make a full backup, or at least back up any data or configuration information you can’t afford to lose. The upgrade tools and process are quite reliable, but a hardware failure in the middle of an upgrade could result in a severely damaged system.

Please read the Debian Release Notes to be clear about the risks

:warning: Warning

Migrating from Debian 11 to Debian 12, as well as upgrading from VitalPBX 4 to VitalPBX 4.5 using this script, involves potential risks.

It is highly recommended to:

  • Create full backups or snapshots of your system before proceeding.
  • Test the script in a non-production environment to ensure stability.
  • Have a rollback plan in place in case of unexpected issues.
  • Run this script as root or with sudo privileges.

Proceed with caution!

:rocket: How to Use

  1. Download the script file.
wget https://raw.githubusercontent.com/VitalPBX/VPBX4toVPBX45SS/refs/heads/main/vpbx4tovpbx45.sh
  1. Make the script executable:
chmod +x vpbx4tovpbx45.sh
  1. Execute the script:
./vpbx4tovpbx45.sh
  1. Configuration Prompts During Script Execution
    When running the script, you may encounter prompts like the following:
*** mpm_event.conf (Y/I/N/O/D/Z) [default=N] ? <press Enter>
........
*** firewalld.conf (Y/I/N/O/D/Z) [default=N] ? <press Enter>
  1. Optional: Remove All Unused Kernels from Version 5.x
dpkg --list | grep 'linux-image-5' | awk '{print $2}' | grep -v "$(uname -r)" | xargs sudo apt remove -y
4 Likes