NTACurrent en:Upgrading Debian 10 to Debian 11

Aus Cryptshare Documentation
Version vom 4. Mai 2022, 09:22 Uhr von imported>Erhardts (→‎Upgrade steps)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu:Navigation, Suche

Overview

This page provides a step-by-step guide for the distribution upgrade from Debian 10 to Debian 11, tailored to the minimal set of packages that are required for Cryptshare for Mail Gateway. To see the full official guide visit https://www.debian.org/releases/bullseye/amd64/release-notes/ch-upgrading.en.html.

Preparation

  • Create a backup/snapshot of the system before installing, to restore the initial state easily.
  • Inform your users about the downtime of the system, which will be (depending on the speed of the internet connection) around 1-2 hours. During the upgrade, messages will not be delivered reliably.

Upgrade steps

  1. Become root:
    sudo su
  2. Remove inofficial packages (config files remain)
    apt remove ansible
    apt remove postfix
    apt autoremove
  3. Clean up /etc/apt/sources.list, replace contents with:
    deb http://deb.debian.org/debian/ buster main
    deb-src http://deb.debian.org/debian/ buster main
    
    deb http://security.debian.org/debian-security buster/updates main
    deb-src http://security.debian.org/debian-security buster/updates main
    
    deb http://deb.debian.org/debian/ buster-updates main
    deb-src http://deb.debian.org/debian/ buster-updates main
  4. Update to latest Buster packages:
    apt update
    apt upgrade
    apt full-upgrade
    apt autoremove
    reboot
  5. Become root again:
    sudo su
  6. Replace contents of /etc/apt/sources.list with:
    deb http://deb.debian.org/debian bullseye main contrib non-free
    deb http://deb.debian.org/debian bullseye-updates main contrib non-free
    deb http://security.debian.org/debian-security bullseye-security main contrib non-free
  7. Perform the upgrade:
    apt clean
    apt update
    apt full-upgrade
  8. Shortly after loading the information for all packages, release notes are displayed. Confirm these with the Q key.
  9. Answer questions during package upgrades.
    • Questions like this:
      Configuration file '/etc/powerdns/recursor.conf'
       ==> Modified (by you or by a script) since installation.
       ==> Package distributor has shipped an updated version.
         What would you like to do about it ? Your options are:
          Y or I  : install the package maintainer's version
          N or O  : keep your currently-installed version
            D     : show the differences between the versions
            Z     : start a shell to examine the situation
       The default action is to keep your current version.
      *** recursor.conf (Y/I/N/O/D/Z) [default=N] ?
      • For /etc/resolvconf/resolv.conf.d/head: N
      • For /etc/opendkim.conf: N
      • For /etc/opendmarc.conf: N
      • For /etc/powerdns/recursor.conf: N
    • Question about dbconfig-common for OpenDMARC: No
    • Question about libc6 upgrade: Yes
    • Question about libc6 automated restarts: Yes
  10. Reboot:
    reboot
  11. Become root again:
    sudo su
  12. Install Postfix and SPF deamon again:
    apt install postfix
    # -> Answer question with "No configuration"
    
    apt install postfix-pgsql
    apt install postfix-policyd-spf-python
  13. Update PostgreSQL
    • Stop services
      systemctl stop cmg-filter
      systemctl stop postgresql
    • Start upgrade
      su postgres
      cd /tmp
      /usr/lib/postgresql/13/bin/pg_upgrade --old-datadir=/var/lib/postgresql/11/main --new-datadir=/var/lib/postgresql/13/main --old-bindir=/usr/lib/postgresql/11/bin --new-bindir=/usr/lib/postgresql/13/bin --old-options '-c config_file=/etc/postgresql/11/main/postgresql.conf' --new-options '-c config_file=/etc/postgresql/13/main/postgresql.conf'
      exit
    • Remove old installation
      apt purge postgresql-11
      # -> Answer question with yes, remove configuration files
      
      apt purge postgresql-client-11
      /tmp/delete_old_cluster.sh
    • Edit /etc/postgresql/13/main/postgresql.conf, change port back to default
      ...
      port = 5432
      ...
    • Restart PostgreSQL service
      systemctl restart postgresql
  14. Reboot one last time:
    reboot