Cette page est en cours de rédaction. Les instructions ci-dessous ne doivent en aucun cas être suivis à moins d'être sûre de ce que vous faites
Prise de notes pour la redaction :
Connexion sur l'ancienne VM iP pour création d'un DD temp (4go) restore
Formatage du nouveau volume
fdsik -l
mkfs.ext3 /dav/sda
[root@sas ~]# mount /dev/sda /mnt/tmp/
[root@sas ~]# df -h
Sys. de fich. Tail. Occ. Disp. %Occ. Mont� sur
/dev/vda2 24G 2,7G 20G 13% /
/dev/vda1 99M 28M 67M 30% /boot
tmpfs 2,0G 0 2,0G 0% /dev/shm
/dev/vdb 29G 8,4G 19G 31% /var
/dev/vdc 971G 583G 339G 64% /home/e-smith
/dev/sda 4,0G 137M 3,7G 4% /mnt/tmp
Arrêt des services
[root@sas ~]# sv d /service/qpsmtpd/
[root@sas ~]# sv d /service/sqpsmtpd/
[root@sas ~]# sv d /service/smbd
[root@sas ~]# sv d /service/httpd-e-smith/
[root@sas ~]# sv d /service/dovecot/
Vérification que le pool qmail est vide :
find /var/qmail/queue/mess/ -type f
Arrêt qmail :
sv d /service/qmail/
Lancement dump BDD:
signal-event pre-backup
Verif :
ll /home/e-smith/db/mysql/
Création du backup :
tar cvzf /mnt/tmp/smeserver.tgz -T dir.list --xattrs
Récupération MAC ancienne NIC : 52:54:00:6e:d5:3f
virsh edit ipasserelle9
------
Lancement console pour démarrer la restauration.
Hack console pour forcer l'apparition du menu si besoin :
/usr/share/perl5/vendor_perl/esmith/console/perform_restore.pm
return 90;
Attachement du DD restore et lancement restauration
------
Création du snapshoot
lvdisplay
lvcreate -s -n ipdatasnap -L20G /dev/vg_data/ipasserelle_data
activation des quotas dans le fstab
quotacheck -cguvm /dev/vdb
lvremove vg_data/ipdata_snap
----
====== Mise à jour de SME8 vers SME9 ======
Une migration SME est toujours unique, en fonction du serveur visé, mais voici les étapes pour une sauvegarde pour un serveur classique simple :
- Création d'un DDE virtuel
- Repérer les répertoires à sauvegarder
- Générer l'archive de sauvegarde
- Restauration des sauvegardes sur SME9
- Finalisation
===== 1) Création d'un DDE virtuel =====
FIXME
===== 2) Repérer les répertoires à sauvegarder =====
==== Core ====
cd /root
cat <<'EOF' > dir.list
/etc/e-smith/templates-custom
/etc/e-smith/templates-user-custom
/etc/group
/etc/gshadow
/etc/passwd
/etc/samba/secrets.tdb
/etc/samba/smbpasswd
/etc/shadow
/etc/smbpasswd
/etc/ssh
/etc/sudoers
/root
/home/e-smith/Maildir
/home/e-smith/home
/home/e-smith/ssl.crt
/home/e-smith/ssl.key
/home/e-smith/db
/var/lib/dhcpd/dhcpd.leases
EOF
find /usr/local/bin/ -type f | xargs -I % sh -c "rpm -qf % 2>&1 > /dev/null || echo % >> dir.list"
find /etc/cron.* -type f | xargs -I % sh -c "rpm -qf % 2>&1 > /dev/null || echo % >> dir.list"
==== smeserver-dovecot ====
rpm -q smeserver-dovecot 2>&1 && cat <<'EOF' >> dir.list
/etc/dovecot/sharemailbox/
EOF
==== PHPki ====
rpm -q phpki >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/opt/phpki/phpki-store/
/opt/phpki/html/config.php
EOF
==== OpenVPN ====
rpm -q smeserver-openvpn-bridge >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/etc/openvpn/bridge/priv
/etc/openvpn/bridge/pub
/var/log/openvpn-bridge
EOF
rpm -q smeserver-openvpn-s2s >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/etc/openvpn/s2s/priv
/etc/openvpn/s2s/pub
/var/log/openvpn-s2s
EOF
rpm -q smeserver-openvpn-routed >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/etc/openvpn/routed/priv
/etc/openvpn/routed/pub
/var/log/openvpn-routed
EOF
==== WebApps ====
=== Pydio ===
rpm -q pydio >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/pydio/files
/var/lib/pydio/personal
/var/lib/pydio/public
/var/log/pydio
EOF
rpm -q ajaxplorer >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/ajaxplorer/files
/var/lib/ajaxplorer/personal
/var/lib/ajaxplorer/public
/var/log/ajaxplorer
EOF
=== DokuWiki ===
rpm -q dokuwiki >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/etc/dokuwiki/acl.auth.php
/etc/dokuwiki/acronyms.conf
/etc/dokuwiki/entities.conf
/etc/dokuwiki/interwiki.conf
/etc/dokuwiki/local.php
/etc/dokuwiki/plugins.local.php
/etc/dokuwiki/scheme.conf
/var/lib/dokuwiki/data/attic
/var/lib/dokuwiki/data/index
/var/lib/dokuwiki/data/media
/var/lib/dokuwiki/data/media_attic
/var/lib/dokuwiki/data/media_meta
/var/lib/dokuwiki/data/meta
/var/lib/dokuwiki/data/pages
EOF
for D in /usr/share/dokuwiki/lib/plugins/*;do
rpm -qf $D >/dev/null 2>&1 || echo $D >> dir.list
done
=== LemonLDAP::NG ===
rpm -q smeserver-lemonldap-ng >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/lemonldap-ng/conf
/var/lib/lemonldap-ng/notifications
EOF
=== Jappix ===
rpm -q smeserver-jappix >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/jappix/
/var/log/jappix
EOF
=== Download Ticket Service ===
rpm -q smeserver-dl >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/dl/
EOF
=== AWStats ===
rpm -q awstats >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/awstats
EOF
=== LimeSurvey ===
rpm -q smeserver-limesurvey >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/limesurvey/uploads
EOF
==== Divers ====
=== Mailman ===
rpm -q smeserver-mailman >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/mailman/
/usr/lib/mailman/aliases
EOF
rpm -q ipasserelle-listes >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/mailman/
/usr/lib/mailman/aliases
EOF
=== Ntop ===
rpm -q smeserver-ntop >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/ntop/
EOF
=== Ejabberd ===
rpm -q ipasserelle-im >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/ejabberd/
/var/log/ejabberd.run
/var/log/ejabberd
EOF
=== Téléphones ===
[ -e /var/lib/phone ] && cat <<'EOF' >> dir.list
/var/lib/phone
EOF
rpm -q smeserver-freepbx >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/opt/freepbx
/var/lib/asterisk/
/etc/asterisk
/var/spool/asterisk/
/var/log/asterisk
EOF
=== SquidGuard ===
rpm -q smeserver-webfilter >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/squidGuard/blacklists/
EOF
=== GRR ===
rpm -q smeserver-grr >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/usr/share/grr/images/
EOF
=== Réglages Firefox / Thunderbird ===
if [ -d /usr/share/mozilla-mcd/ ]; then
for F in /usr/share/mozilla-mcd/*;do
rpm -qf $F >/dev/null 2>&1 || echo $F >> dir.list
done
fi
===== Cut'n'past pour backup complet =====
Voici un script réunissant l’ensemble des datas à sauvegarder à copier/coller directement :
cd /root
cat <<'EOF' > dir.list
/etc/e-smith/templates-custom
/etc/e-smith/templates-user-custom
/etc/group
/etc/gshadow
/etc/passwd
/etc/samba/secrets.tdb
/etc/samba/smbpasswd
/etc/shadow
/etc/smbpasswd
/etc/ssh
/etc/sudoers
/root
/home/e-smith/Maildir
/home/e-smith/home
/home/e-smith/ssl.crt
/home/e-smith/ssl.key
/home/e-smith/db
/var/lib/dhcpd/dhcpd.leases
/var/log/qpsmtpd
/var/log/sqpsmtpd
/var/log/qmail
/var/log/smb_audit.*
/var/log/httpd/
/var/log/dovecot/
/var/log/squid
EOF
find /usr/local/bin/ -type f | xargs -I % sh -c "rpm -qf % 2>&1 > /dev/null || echo % >> dir.list"
find /etc/cron.* -type f | xargs -I % sh -c "rpm -qf % 2>&1 > /dev/null || echo % >> dir.list"
rpm -q smeserver-dovecot 2>&1 && cat <<'EOF' >> dir.list
/etc/dovecot/sharemailbox/
EOF
rpm -q phpki >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/opt/phpki/phpki-store/
/opt/phpki/html/config.php
EOF
rpm -q smeserver-openvpn-bridge >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/etc/openvpn/bridge/priv
/etc/openvpn/bridge/pub
/var/log/openvpn-bridge
EOF
rpm -q smeserver-openvpn-s2s >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/etc/openvpn/s2s/priv
/etc/openvpn/s2s/pub
/var/log/openvpn-s2s
EOF
rpm -q smeserver-openvpn-routed >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/etc/openvpn/routed/priv
/etc/openvpn/routed/pub
/var/log/openvpn-routed
EOF
rpm -q pydio >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/pydio/files
/var/lib/pydio/personal
/var/lib/pydio/public
/var/log/pydio
EOF
rpm -q dokuwiki >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/etc/dokuwiki/acl.auth.php
/etc/dokuwiki/acronyms.conf
/etc/dokuwiki/entities.conf
/etc/dokuwiki/interwiki.conf
/etc/dokuwiki/local.php
/etc/dokuwiki/plugins.local.php
/etc/dokuwiki/scheme.conf
/var/lib/dokuwiki/data/attic
/var/lib/dokuwiki/data/index
/var/lib/dokuwiki/data/media
/var/lib/dokuwiki/data/media_attic
/var/lib/dokuwiki/data/media_meta
/var/lib/dokuwiki/data/meta
/var/lib/dokuwiki/data/pages
EOF
for D in /usr/share/dokuwiki/lib/plugins/*;do
rpm -qf $D >/dev/null 2>&1 || echo $D >> dir.list
done
rpm -q smeserver-lemonldap-ng >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/lemonldap-ng/conf
/var/lib/lemonldap-ng/notifications
EOF
rpm -q smeserver-jappix >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/jappix/
/var/log/jappix
EOF
rpm -q smeserver-dl >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/dl/
EOF
rpm -q awstats >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/awstats
EOF
rpm -q smeserver-limesurvey >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/limesurvey/uploads
EOF
rpm -q smeserver-mailman >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/mailman/
/usr/lib/mailman/aliases/
EOF
rpm -q ipasserelle-listes >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/mailman/
/usr/lib/mailman/aliases/
EOF
rpm -q smeserver-ntop >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/ntop/
EOF
rpm -q ipasserelle-im >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/lib/ejabberd/
/var/log/ejabberd.run
EOF
[ -e /var/lib/phone ] && cat <<'EOF' >> dir.list
/var/lib/phone
EOF
rpm -q smeserver-freepbx >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/opt/freepbx
/var/lib/asterisk/
/etc/asterisk
/var/spool/asterisk/
/var/log/asterisk
EOF
rpm -q smeserver-webfilter >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/var/squidGuard/blacklists/
EOF
rpm -q smeserver-grr >/dev/null 2>&1 && cat <<'EOF' >> dir.list
/usr/share/grr/images/
EOF
if [ -d /usr/share/mozilla-mcd/ ]; then
for F in /usr/share/mozilla-mcd/*;do
rpm -qf $F >/dev/null 2>&1 || echo $F >> dir.list
done
fi
Une fois terminé, le fichier **dir.list** généré contient l'ensemble des path à sauvegarder. Il ne reste plus qu'à générer l'archive.
===== 3) Générer l'archive de sauvegarde =====
Avant de commencer, nous allons procéder à l'arrêt de tous les services :
sv d /service/qmail
sv d /service/qpsmtpd
sv d /service/sqpsmtpd
sv d /service/ejabberd
sv d /service/smbd
sv d /service/httpd-e-smith
Génération des dump SQL en l'état :
signal-event pre-backup
Création de l'archive :
tar cvzf ~fws/smeserver.tgz -T dir.list --xattrs
Le fichier de sauvegarde **smeserver.tgz** est prêt.
===== 4) Restauration des sauvegardes sur SME9 =====
En fonction du point de montage des fichiers, il faut s'assurer que le path est ''/home/e-smith'' ou ''/home/e-smith/files''.
FIXME
===== 5) Finalisation =====
FIXME