MrGeneration

MrGeneration / Debian / Ubuntu Upgrade

Last active 4 months ago

Like 0

This gist provides contextual copy paste options for Distribution upgrades with installed Zammad and PostgreSQL for Debian (10, 11, 12) and Ubuntu (18, 20, 22). Video context to this: https://youtu.be/IXp4VWU27wo

Revision 84d671a6bfc008e73b0e6d3f795322f33d158986

1-general-prerequisites-before-upgrade.sh Raw
1systemctl disable zammad --now
2apt-mark hold zammad
3apt update
4apt upgrade
5
6# Continue with step 2 or 3 depending on your current state
7
2-debian-10-to-11-repositories.sh Raw
1sed -i 's/security\.debian\.org buster\/updates/security\.debian\.org bullseye-security/g' /etc/apt/sources.list
2sed -i 's/debian-security buster\/updates/ bullseye-security/g' /etc/apt/sources.list
3sed -i 's/buster/bullseye/g' /etc/apt/sources.list
4sed -i 's/debian 10/debian 11/g' /etc/apt/sources.list.d/zammad.list
5apt clean; apt update
6apt upgrade
7apt dist-upgrade
8
9pg_dropcluster --stop 13 main
10pg_upgradecluster 11 main /var/lib/postgresql/13/
11
12apt autoremove
13shutdown -r now
14
2-ubuntu-18-to-20-repositories.sh Raw
1sed -i 's/bionic/focal/g' /etc/apt/sources.list
2sed -i 's/ubuntu 18/ubuntu 20/g' /etc/apt/sources.list.d/zammad.list
3apt clean; apt update
4apt upgrade
5apt dist-upgrade
6
7pg_dropcluster --stop 12 main
8pg_upgradecluster 10 main /var/lib/postgresql/12/
9
10apt autoremove
11shutdown -r now
12
3-debian-11-to-12-repositories.sh Raw
1sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list
2sed -i 's/debian 11/debian 12/g' /etc/apt/sources.list.d/zammad.list
3apt clean; apt update
4apt upgrade
5apt dist-upgrade
6
7pg_dropcluster --stop 15 main
8pg_upgradecluster 13 main /var/lib/postgresql/15/
9
10apt autoremove
11shutdown -r now
12
3-ubuntu-20-to-22-repositories.sh Raw
1sed -i 's/focal/jammy/g' /etc/apt/sources.list
2sed -i 's/ubuntu 20/ubuntu 22/g' /etc/apt/sources.list.d/zammad.list
3apt clean; apt update
4apt upgrade
5apt dist-upgrade
6
7pg_dropcluster --stop 14 main
8pg_upgradecluster 12 main /var/lib/postgresql/14/
9
10apt autoremove
11shutdown -r now
12
4-finish-upgrade.sh Raw
1apt-mark unhold zammad
2systemctl enable zammad
3apt update
4apt install zammad
5
pro-tip-huge-instance.sh Raw
1# The following action is NOT reversible but is significantly faster.
2# Use at own descression - replace oldversion with your old version and newversion with your new version
3
4pg_upgradecluster --method=upgrade --link <oldversion> main /var/lib/postgresql/<newversion>/