The update process depends very much on the customisation that has been made to your Esia plugins.
The more plugins you have added, the greater the risk that these plugins will go into error after the update. It is therefore all the more important to respect the backup process in addition to the snapshot in order to avoid having to perform a rollback.
The rest of the tutorial covers :
We strongly recommend that you read this tutorial in its entirety at least 1 time before starting the production update.
Before starting the update, all of the following points must be met:
The following 3 steps should be carried out in the desired order.
This will avoid having to return to the snapshot in the event of a simple plugin error or similar. Plugin errors are sometimes unavoidable and make this task necessary.
Check that you have enough disk space for the backup using the command :
df -h /root
The disk space required for the backup depends on your Esia. But if you use less than 50% of your disk space. You are sure to have enough.
#!/bin/bash cd / mkdir -p /root/BACKUP_ESIA su postgres -c pg_dumpall > /root/BACKUP_ESIA/pg_database.sql cp -r /usr/local/esia/plugins /root/BACKUP_ESIA/plugins cp -r /usr/local/esia/public_html /root/BACKUP_ESIA/public_html cp -r /etc/apache2 /root/BACKUP_ESIA/apache2 cp -r /etc/esia /root/BACKUP_ESIA/esia_conf iptables-save > /root/BACKUP_ESIA/iptables.txt dpkg -l > /root/BACKUP_ESIA/version.txt
You can check whether the backup was successful by entering the following command:
du -sh /root/BACKUP_ESIA/*
On a small esia
root@debian:~# cd / root@debian:/# mkdir -p /root/BACKUP_ESIA root@debian:/# su postgres -c pg_dumpall > /root/BACKUP_ESIA/pg_database.sql root@debian:/# cp -r /usr/local/esia/plugins /root/BACKUP_ESIA/plugins root@debian:/# cp -r /usr/local/esia/public_html /root/BACKUP_ESIA/public_html root@debian:/# cp -r /etc/apache2 /root/BACKUP_ESIA/apache2 root@debian:/# cp -r /etc/esia /root/BACKUP_ESIA/esia_conf root@debian:/# iptables-save > /root/BACKUP_ESIA/iptables.txt root@debian:/# dpkg -l > /root/BACKUP_ESIA/version.txt root@debian:/# du -sh /root/BACKUP_ESIA/* 652K /root/BACKUP_ESIA/apache2 32K /root/BACKUP_ESIA/esia_conf 4,0K /root/BACKUP_ESIA/iptables.txt 660K /root/BACKUP_ESIA/pg_database.sql 7.9M /root/BACKUP_ESIA/plugins 23M /root/BACKUP_ESIA/public_html 96K /root/BACKUP_ESIA/version.txt root@debian-jessie:/#
In case of error, files/directories are missing or empty
root@debian:/# cd / root@debian:/# mkdir -p /root/BACKUP_ESIA root@debian:/# su postgres -c pg_dumpall > /root/BACKUP_ESIA/pg_database.sql pg_dumpall: could not connect to database "template1": could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? root@debian:/# cp -r /usr/local/esia/plugins /root/BACKUP_ESIA/plugins root@debian:/# cp -r /usr/local/esia/public_html /root/BACKUP_ESIA/public_html root@debian:/# cp -r /etc/apache2 /root/BACKUP_ESIA/apache2 root@debian:/# cp -r /etc/esia /root/BACKUP_ESIA/esia_conf root@debian:/# iptables-save > /root/BACKUP_ESIA/iptables.txt root@debian:/# dpkg -l > /root/BACKUP_ESIA/version.txt root@debian-jessie:/# du -sh /root/BACKUP_ESIA/* 652K /root/BACKUP_ESIA/apache2 32K /root/BACKUP_ESIA/esia_conf 4,0K /root/BACKUP_ESIA/iptables.txt 0 /root/BACKUP_ESIA/pg_database.sql 7.9M /root/BACKUP_ESIA/plugins 23M /root/BACKUP_ESIA/public_html 96K /root/BACKUP_ESIA/version.txt root@debian-jessie:/#
In order to come back quickly in case of a complete crash.
To avoid receiving false positives during the update.
chmod -x /usr/local/esia/plugins/alerting/*
Check that the Esia repository is present in your source file.
cat /etc/apt/sources.list
You should have this line in your
deb http://stable.repository.esia-sa.com/esia bullseye contrib non-free
Update the list of your packages with the following command
apt update
root@debian-jessie:/# apt-get update Get:1 http://10.8.0.9 stretch InRelease [2,271 B] Get:2 http://10.8.0.9 stretch/contrib amd64 Packages [7,200 B] Get:3 http://10.8.0.9 stretch/non-free amd64 Packages [1,963 B] Ign http://10.8.0.9 stretch/contrib Translation-en_US Ign http://10.8.0.9 stretch/contrib Translation-en Ign http://10.8.0.9 stretch/non-free Translation-en_US Ign http://10.8.0.9 stretch/non-free Translation-en Ign http://ftp.be.debian.org stretch InRelease Get:4 http://ftp.be.debian.org stretch Release.gpg [2,410 B] Get:5 http://ftp.be.debian.org stretch Release [118 kB] Get:6 http://ftp.be.debian.org stretch/main amd64 Packages [7,080 kB] Get:7 http://ftp.be.debian.org stretch/main Translation-en [5,377 kB] Fetched 12.6 MB in 2s (4,354 kB/s) Reading package lists... Done root@debian-jessie:/#
Note what time it is.
Update the list of your packages with the following command
apt-get update
To download the ESIA + OS update
apt-get dist-upgrade
Before confirming, check that you have enough disk space:
In the example below, you will need 92 MB + 101 MB during installation.
125 upgraded, 1 newly installed, 4 to remove and 0 not upgraded. Need to get 92 MB of archives. After this operation, 101 MB of additional disk space will be used. Do you want to continue? [Y/n]
The apt program will now update your Esia and your operating system.
Once the update is complete, don't forget to reload your browser's cache.
Once your Esia is working properly, don't forget to reactivate the alerting system:
chmod +x /usr/local/esia/plugins/alerting/*
ls --color -l /usr/local/esia/plugins/alerting/*
In the examples below, the green colour indicates that the scripts are executable. They are therefore activated.
Alerting disabled
Alerting on
Now you need to check that you are receiving the alert emails.
/usr/local/esia/plugins/alerting/send_mail_html.pl -e min -t <votre adresse mail> -D
Check whether an email has arrived in your inbox.