Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.
Commentaire: Published by Scroll Versions from space DA and version BM-3.5
Sv translation
languagefr

Cette documentation décrit la façon de changer la distribution sur laquelle fonctionne BlueMind. Elle peut-être utilisée pour mettre à jour la distribution (Ubuntu 14.04 vers Ubuntu 16.04 par exemple).

Cette procédure est basée sur l'installation d'un système cible sur lequel les données seront migrées. Ce nouveau système prendra ensuite la place, au niveau réseau, du premier.

Pré-requis

  • installer sur le système cible un BlueMind en version identique au système d'origine et configuré avec la même external-url. L'installation wizard (ou le setup wizard) doit avoir été joué sur le serveur cible. Par exemple:
    • si le système d'origine utilise BlueMind 3.5.12-7, le système cible doit avoir un BlueMind 3.5.12-7
    • si l'external-url d'origine est bluemind.domain.tld, le BlueMind du système cible doit être configuré avec l'external-url bluemind.domain.tld
    • installer une souscription valide pour cet OS
  • l'utilisateur root du serveur cible doit pouvoir s'authentifier en tant que root sur le serveur d'origine, idéalement en authentification par clé
  • l'utilitaire rsync doit-être installé sur les 2 systèmes

Migration

La migration des données se passe en 3 temps afin de minimiser l'indisponibilité du service:

  1. synchronisation à chaud des données du serveur source vers le serveur cible - opération longue mais ne provoquant pas de coupure de service
  2. synchronisation à froid - opération rapide mais provoquant une coupure de service
  3. remplacement des serveurs

Synchronisation à chaud

Permet de faire la copie initiale des données sans coupure du service:

  1. se connecter en tant que root sur le serveur cible
  2. stopper les services sur les serveurs cible:

    Bloc de code
    languagebash
    # bmctl stop
    # service postfix stop
  3. synchroniser les données de BlueMind via l'utilitaire rsync:

    Bloc de code
    languagebash
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/cyrus/ /var/spool/cyrus/
    # rsync -avH --delete root@origsrv.domain.tld:/var/lib/cyrus/ /var/lib/cyrus/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-hsm/ /var/spool/bm-hsm/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/sieve/ /var/spool/sieve/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-elasticsearch/ /var/spool/bm-elasticsearch/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-docs/ /var/spool/bm-docs/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-filehosting/ /var/spool/bm-filehosting/

Ces opérations peuvent-être interrompues et/ou réalisées plusieurs fois.

Note: Plus le temps entre la synchronisation à chaud et la synchronisation à froid est court, plus la synchronisation à froid sera rapide.

Synchronisation à froid

  1. stopper les services sur les serveurs (origine et cible):

    Bloc de code
    languagebash
    # bmctl stop
    # service postfix stop
  2. depuis le serveur cible, refaire une synchronisation des données:

    Bloc de code
    languagebash
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/cyrus/ /var/spool/cyrus/
    # rsync -avH --delete root@origsrv.domain.tld:/var/lib/cyrus/ /var/lib/cyrus/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-hsm/ /var/spool/bm-hsm/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/sieve/ /var/spool/sieve/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-elasticsearch/ /var/spool/bm-elasticsearch/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-docs/ /var/spool/bm-docs/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-filehosting/ /var/spool/bm-filehosting/
  3. depuis le serveur cible, réaliser un dump de la base de données du serveur d'origine:

    Bloc de code
    languagebash
    # ssh root@origsrv.domain.tld "PGPASSWORD=bj pg_dump -U bj -h localhost bj" > /tmp/db.sql
  4. depuis le serveur cible, copier les fichiers du serveur origine vers le serveur cible:

    Bloc de code
    languagebash
    # scp -r root@origsrv.domain.tld:/etc/bm/* /etc/bm
    # scp root@origsrv.domain.tld:/etc/bm/bm.ini /etc/bm/bm.ini
    # scp -r root@origsrv.domain.tld:/etc/bm-hps/* /etc/bm-hps
    
    # scp root@origsrv.domain.tld:/etc/ssl/certs/bm_cert.pem /etc/ssl/certs/bm_cert.pem
    
    # scp -r root@origsrv.domain.tld:/var/lib/bm-ca/* /var/lib/bm-ca
    
    # scp root@origsrv.domain.tld:/usr/share/bm-elasticsearch/config/elasticsearch.yml /usr/share/bm-elasticsearch/config/elasticsearch.yml
    
    # scp root@origsrv.domain.tld:/etc/imapd* /etc/
    # scp root@origsrv.domain.tld:/etc/cyrus* /etc/
    
    # scp root@origsrv.domain.tld:/etc/postfix/main.cf /etc/postfix/main.cf
    # scp root@origsrv.domain.tld:/etc/postfix/master.cf /etc/postfix/master.cf
    # scp root@origsrv.domain.tld:/etc/postfix/master_relay_transport-flat /etc/postfix/master_relay_transport-flat
    # scp root@origsrv.domain.tld:/etc/postfix/master_relay_transport.db /etc/postfix/master_relay_transport.db
    # scp root@origsrv.domain.tld:/etc/postfix/transport-flat /etc/postfix/transport-flat
    # scp root@origsrv.domain.tld:/etc/postfix/transport.db /etc/postfix/transport.db
    # scp root@origsrv.domain.tld:/etc/postfix/virtual_alias-flat /etc/postfix/virtual_alias-flat
    # scp root@origsrv.domain.tld:/etc/postfix/virtual_alias.db /etc/postfix/virtual_alias.db
    # scp root@origsrv.domain.tld:/etc/postfix/virtual_domains-flat /etc/postfix/virtual_domains-flat
    # scp root@origsrv.domain.tld:/etc/postfix/virtual_domains.db /etc/postfix/virtual_domains.db
    # scp root@origsrv.domain.tld:/etc/postfix/virtual_mailbox-flat /etc/postfix/virtual_mailbox-flat
    # scp root@origsrv.domain.tld:/etc/postfix/virtual_mailbox.db /etc/postfix/virtual_mailbox.db
    # scp root@origsrv.domain.tld:/etc/bm-webmail/* /etc/bm-webmail/
  5. re-monter la base de données sur le serveur cible:

    Bloc de code
    languagebash
    # su - postgres
    $ dropdb bj
    $ createdb bj
    $ exit
    # export PGPASSWORD=bj
    # cat /tmp/db.sql | psql -U bj -h localhost bj

Remplacement des serveurs

  1. stopper le serveur d'origine
  2. re-configurer le serveur cible pour lui attribuer l'adresse IP du serveur d'origine
  3. re-démarrer le serveur cible et le connecter au réseau à la place du serveur d'origine afin qu'il soit joignable à la place du serveur origine

Post-migration

Se connecter à la console d'administration de BlueMind en tant qu'utilisateur admin0@global.virt puis:

  1. Se rendre dans la partie Sécurité > Gestion du pare-feu et cliquer immédiatement sur le bouton "Enregistrer" pour forcer la re-génération des règles du parefeu BlueMind
  2. Se rendre dans la partie Gestion du Système > Maintenance des mails, cliquer sur le bouton "Exécuter" pour re-générer les tables de routage de mails postfix
  3. Se rendre dans la partie Gestion du Système > Configuration Système et remplacer l'ancienne adresse IP du champ "Mes réseaux" par la nouvelle adresse ou plage d'adresse pour laquelle on souhaite être relais ouvert avant de cliquer sur le bouton "Enregistrer"
Sv translation
languageen

This article describes how to change the distribution BlueMind works on. It can be used to update the distribution (Ubuntu 12.04 to Ubuntu 14.04 for instance).

This procedure is based on installing a target system to which the data is migrated. This new system will then replace the original one at the network level.

Prerequisites

  • install BlueMind on the target system in an identical version to the original system and configured with the same external-url. The Setup Wizard must have been run on the target server. E.g.:
    • if the original system uses BlueMind 3.5.12-2, the target system must have BlueMind 3.5.12-2 installed
    • if the original external-url is bluemind.domain.tld, the target system's BlueMind must be configured with the external-url bluemind.domain.tld
    • install a valid subscription for this OS
  • the target system's root user must be able to authenticate as root on the original server, ideally using key authentication.
  • the rsync utility must be installed on both systems.

Migration

Data migration is done in three steps to minimize service downtime:

  • hot synchronization of server data to the target server - this is a time-consuming operation but does not cause service interruption
  • cold synchronization - quick operation but causes service interruption
  • switching servers

Hot synchronization

Allows you to make an initial copy of data without interrupting the service:

  1. connect to the target server as root
  2. stop services on the target servers:

    Bloc de code
    languagebash
    # bmctl stop
    # service postfix stop
  3. synchronize BlueMind data using the rsync utility:

    Bloc de code
    languagebash
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/cyrus/ /var/spool/cyrus/
    # rsync -avH --delete root@origsrv.domain.tld:/var/lib/cyrus/ /var/lib/cyrus/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-hsm/ /var/spool/bm-hsm/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/sieve/ /var/spool/sieve/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-elasticsearch/ /var/spool/bm-elasticsearch/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-docs/ /var/spool/bm-docs/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-filehosting/ /var/spool/bm-filehosting/

These operations can be interrupted and/or performed several times.

Note: The shorter the time between hot synchronization and cold synchronization, the faster cold synchronization will be.

Cold synchronization

  1. Stop services on the servers (original and target):

    Bloc de code
    languagebash
    # bmctl stop
    # service postfix stop
  2. In the target server, synchronize the data again:

    Bloc de code
    languagebash
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/cyrus/ /var/spool/cyrus/
    # rsync -avH --delete root@origsrv.domain.tld:/var/lib/cyrus/ /var/lib/cyrus/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-hsm/ /var/spool/bm-hsm/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/sieve/ /var/spool/sieve/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-elasticsearch/ /var/spool/bm-elasticsearch/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-docs/ /var/spool/bm-docs/
    # rsync -avH --delete root@origsrv.domain.tld:/var/spool/bm-filehosting/ /var/spool/bm-filehosting/
  3. In the target server, do a database dump for the original server data:

    Bloc de code
    languagebash
    # ssh root@origsrv.domain.tld "PGPASSWORD=bj pg_dump -U bj -h localhost bj" > /tmp/db.sql
  4. In the target server, copy the original server's files to the target server:

    Bloc de code
    languagebash
    # scp -r root@origsrv.domain.tld:/etc/bm/* /etc/bm
    # scp root@origsrv.domain.tld:/etc/bm/bm.ini /etc/bm/bm.ini
    # scp -r root@origsrv.domain.tld:/etc/bm-hps/* /etc/bm-hps
    
    # scp root@origsrv.domain.tld:/etc/ssl/certs/bm_cert.pem /etc/ssl/certs/bm_cert.pem
    
    # scp -r root@origsrv.domain.tld:/var/lib/bm-ca/* /var/lib/bm-ca
    
    # scp root@origsrv.domain.tld:/etc/bm/mcast.id /etc/bm/mcast.id
    # scp root@origsrv.domain.tld:/usr/share/bm-elasticsearch/config/elasticsearch.yml /usr/share/bm-elasticsearch/config/elasticsearch.yml
    
    # scp root@origsrv.domain.tld:/etc/imapd* /etc/
    # scp root@origsrv.domain.tld:/etc/cyrus* /etc/
    
    # scp root@origsrv.domain.tld:/etc/postfix/main.cf /etc/postfix/main.cf
    # scp root@origsrv.domain.tld:/etc/postfix/master.cf /etc/postfix/master.cf
    # scp root@origsrv.domain.tld:/etc/postfix/master_relay_transport-flat /etc/postfix/master_relay_transport-flat
    # scp root@origsrv.domain.tld:/etc/postfix/master_relay_transport.db /etc/postfix/master_relay_transport.db
    # scp root@origsrv.domain.tld:/etc/postfix/transport-flat /etc/postfix/transport-flat
    # scp root@origsrv.domain.tld:/etc/postfix/transport.db /etc/postfix/transport.db
    # scp root@origsrv.domain.tld:/etc/postfix/virtual_alias-flat /etc/postfix/virtual_alias-flat
    # scp root@origsrv.domain.tld:/etc/postfix/virtual_alias.db /etc/postfix/virtual_alias.db
    # scp root@origsrv.domain.tld:/etc/postfix/virtual_domains-flat /etc/postfix/virtual_domains-flat
    # scp root@origsrv.domain.tld:/etc/postfix/virtual_domains.db /etc/postfix/virtual_domains.db
    # scp root@origsrv.domain.tld:/etc/postfix/virtual_mailbox-flat /etc/postfix/virtual_mailbox-flat
    # scp root@origsrv.domain.tld:/etc/postfix/virtual_mailbox.db /etc/postfix/virtual_mailbox.db
  5. Import the database into the target server:

    Bloc de code
    languagebash
    # su - postgres
    $ dropdb bj
    $ createdb bj
    $ exit
    # PGPASSWORD=bj cat /tmp/db.sql | psql -U bj -h localhost bj

Switching servers

  1. Stop the original server
  2. Reconfigure the target server with the original server's IP address
  3. Restart the target server and connect to the network instead of the original server so that it can be reached instead of the original server

Post-migration

Connect to the BlueMind Administration console as admin0@global.virt and:

  • Go to the section Security > Firewall and immediately click "Save" to force the BlueMind firewall's rules regeneration
  • Go to System Management > Mail Maintenance, click "Run" to regenerate the mail postfix routing tables
  • Go to System Management > System Configuration and replace the old IP address in the "My Networks" field by the new address or the address range for which you want the relay open and click "Save"