Debian 11 to Debian 12 upgrade

wouam31

Member
Jul 1, 2022
111
15
18
Hello everyone!
I have a FusionPBX version 5.3.4 up to date:

  • Switch Version: 1.10.9 (64-bit)
  • PHP Version: 8.1.31
  • Operating System: Debian
  • Version: 11
  • PostgreSQL: 13.18 (Debian 13.18-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
I would like to upgrade my Debian 11 to version 12.
Will this have any impact on my FusionPBX installation?

Thank you in advance.





#!/bin/bash





# Script to upgrade Debian 11 to Debian 12
# Use with caution. Make sure you have a full backup before proceeding.
set -e # Stop the script in case of an error

echo "=== Starting Debian 11 to Debian 12 upgrade ==="

# Check the current version
echo "=== Checking the current version ==="
current_version=$(cat /etc/debian_version)
echo "Current version: $current_version"

if [[ "$current_version" != 11* ]]; then
echo "This script is designed for Debian 11 only. Exiting."
exit 1

fi

# Update the current system
echo "=== Updating the current system ==="
sudo apt update && sudo apt upgrade -y && sudo apt full-upgrade -y
echo "=== Cleaning up the system ==="
sudo apt autoremove --purge -y && sudo apt autoclean

# Backup the sources.list
echo "=== Backing up /etc/apt/sources.list ==="
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

# Modify the sources.list
echo "=== Modifying /etc/apt/sources.list ==="
sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list

# Update the package list
echo "=== Updating the package list ==="
sudo apt update

# Simulate the upgrade
echo "=== Simulating the upgrade ==="
sudo apt upgrade --simulate

# Ask for confirmation before proceeding
read -p "Do you want to proceed with the upgrade? (yes/no): " confirmation
if [[ "$confirmation" != "yes" ]]; then
echo "Upgrade cancelled."
exit 0
fi

# Perform the full upgrade
echo "=== Performing the full upgrade to Debian 12 ==="
sudo apt upgrade -y && sudo apt full-upgrade -y

# Final cleanup
echo "=== Final cleanup ==="
sudo apt autoremove --purge -y

# Reboot the system
echo "=== Upgrade completed. Rebooting the system... ==="
sudo reboot