Upgrade Debian from bullseye to bookworm and PVE7 to PVE8

Here is a short checklist to upgrade Debian to latest bookworm version;

Proxmox update goes with Debian Latest stable version. I am running BullEye and need to upgrade to BookWorm.

Run checklist (a small script that comes with Proxmox):

pve7to8

Fix errors and warnings reported by above script.

Next change repositories for Debian and Proxmos;

1. update the configured APT repositories
   apt update
   apt dist-upgrade
   pveversion

   This should report at least 7.4-15 or newer version.

2. CEPH
   nano /etc/apt/sources.list.d/ceph.list
   make sure there is just one entry.
	

3. Bulleye to BookWorm
   nano /etc/apt/sources.list
   or better, run this command to search and replace bullye to
   bookworm

   sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list
   Output
   ------
   # security updates
   #deb http://security.debian.org bookworm-security main contrib

   # My repo changes
   deb http://deb.debian.org/debian/ bookworm main contrib non-free
   deb http://deb.debian.org/debian/ bookworm-updates main non-free contrib
   # security updates
   deb http://security.debian.org/debian-security bookworm-security main contrib non-free

   # PVE pve-no-subscription repository provided by proxmox.com,
   # NOT recommended for production use
   deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription

4. APT Repositorys
   I don't have special repositories here. so don't worry about this.

Install this package if using EFI to boot box;

apt install grub-efi-amd64

To clear CEPH warnings, reset Ceph monitor on VM.

Remove any used packages with this command;

apt autoremove

Re-run scan;

pve7to8

Make sure to disable enterprise library if using evaluation version;

modify enterprise repo;

nano /etc/apt/sources.list.d/pve-enterprise.list

and add a # at the beginning. Save this file 

Restart your nodes one by one.

References

https://pve.proxmox.com/wiki/Upgrade_from_7_to_8

https://pve.proxmox.com/wiki/Ceph_Nautilus_to_Octopus

Proxmox alert configuration via gmail

A short list to configure Proxmox VE to send alert using Gmail account;

#--------- Proxmox email configuration -------------

# Install authentication libraries
apt-get install libsasl2-modules

Configure app passwords on your Google account

https://myaccount.google.com/apppasswords

# Configure postfix
echo "smtp.gmail.com <youremail>@gmail.com:<app-password>"> /etc/postfix/sasl_passwd

# update permissions
chmod 600 /etc/postfix/sasl_passwd

# hash the file
postmap hash:/etc/postfix/sasl_passwd


# check to to be sure the db file was create
cat /etc/postfix/sasl_passwd.db

# edit postfix config
nano /etc/postfix/main.cf

# google mail configuration

relayhost = smtp.gmail.com:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/Entrust_Root_Certification_Authority.pem
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
smtp_tls_session_cache_timeout = 3600s

# reload postfix
postfix reload

# send a test emails
echo "This is a test message sent from postfix on my Proxmox Server" | mail -s "Test Email from Proxmox" <your-email>@gmail.com
date | mail -s “test” <your-email>@gmail.com

# Now, fix from name in email

# install dependency
apt update
apt install postfix-pcre

# edit config
nano /etc/postfix/smtp_header_checks

# add the following text
/^From:.*/ REPLACE From: pvetower-alert pvetower-alert@<your-email>.com

# hash the file
postmap hash:/etc/postfix/smtp_header_checks

# check the contents of the file
cat /etc/postfix/smtp_header_checks.db

# add the module to our postfix config
nano /etc/postfix/main.cf

# add to the end of the file
smtp_header_checks = pcre:/etc/postfix/smtp_header_checks

# reload postfix service
postfix reload


# send a test emails
date | mail -s “test” <your-email>@gmail.com

--done

References

# steps reference list;
https://docs.technotim.live/posts/proxmox-alerts/
https://forum.proxmox.com/threads/proxmox-setup-for-gmail.13405/