Migración del servidor NethService/SME

Migration is the process to convert a SME Server/NethService machine (source) into a NethServer (destination). It can be achieved from a backup or using rsync.

Nota

No se migra ninguna plantilla personalizada durante el proceso de migración. Compruebe los archivos de la plantilla nueva antes de copiar cualquier fragmento personalizado de la copia de seguridad antigua.

Advertencia

Antes de ejecutar el procedimiento de migración, lea atentamente todas las secciones de este capítulo.

Proveedor de cuentas

Debe configurar un proveedor de cuentas antes de iniciar el procedimiento de migración.

  • Si el sistema de origen se unió a un dominio de Active Directory (la función de servidor Samba era ADS), configure un proveedor de cuentas remoto de Active Directory.

  • Si el sistema de origen era un Primary Domain Controller de NT (el rol del servidor de Samba era PDC), instale un proveedor de cuentas Active Directory local.

  • Si el acceso a carpetas compartidas en el sistema de destino requiere autenticación de usuario, instale un proveedor de cuentas Active Directory local.

  • En cualquier otro caso, instale un proveedor de cuentas LDAP local.

If you choose a local Active Directory accounts provider, remember to fully configure and start the DC before executing the migration-import event. See Proveedores de cuentas.

Furthermore, the following accounts are ignored by the migration procedure because they are already provided by Active Directory:

  • administrator

  • guest

  • krbtgt

Correo electrónico

Before running NethServer in production, some considerations about the network and existing mail client configurations are required: what ports are in use, if SMTPAUTH and TLS are enabled. Refer to mail client configuration and Políticas especiales de acceso SMTP section for more information.

En una migración de servidor de correo, el servidor de correo de origen podría estar en producción incluso después de que se haya realizado la copia de seguridad y los mensajes de correo electrónico continúan siendo entregados hasta que se borran permanentemente.

Un script de ayuda basado en rsync es proporcionado por el paquete nethserver-mail-server. Se ejecuta en el host de destino y sincroniza los buzones de destino con el host de origen:

Usage:
    /usr/share/doc/nethserver-mail-server-<VERSION>/sync_maildirs.sh [-h] [-n] [-p] -s IPADDR
        -h          help message
        -n          dry run
        -p PORT     ssh port on source host (default 22)
        -s IPADDR   rsync from source host IPADDR
        -t TYPE     source type: sme8 (default), ns6

El host de origen en IPADDR debe ser accesible por el usuario root, a través de ssh con autenticación de clave pública.

Apache

La configuración de la suite de cifrado SSL no se migra automáticamente porque el sistema de origen utiliza un conjunto de cifrado débil de forma predeterminada. Para migrarlo manualmente, ejecute los siguientes comandos:

MIGRATION_PATH=/var/lib/migration
config setprop httpd SSLCipherSuite $(db $MIGRATION_PATH/home/e-smith/db/configuration getprop modSSL CipherSuite)
signal-event nethserver-httpd-update

Ibays

El concepto ibay ha sido reemplazado por Carpetas compartidas. Los protocolos soportados para acceder a Carpetas compartidas son:

  • SFTP, proporcionado por el demonio sshd

  • Protocolo de intercambio de archivos SMB, típico de las redes de Windows, implementado por Samba

Advertencia

Read carefully the Carpetas compartidas section in the Actualizar desde NethServer 6 chapter, because the connection credentials may change when migrating to NethServer 7.

A partir de |product |version|, las carpetas compartidas no están configuradas para el acceso HTTP. Después del evento migration-import, los ibays antiguos podrían migrarse de acuerdo con las siguientes reglas empíricas:

  1. Si el ibay era un host virtual, instale el módulo «Servidor web» desde la página Centro de software. Copie el contenido ibay en el directorio raíz del host virtual. Refiérase a Virtual hosts.

  2. Si el acceso ibay estaba restringido con una contraseña secreta (por ejemplo, para compartir contenido con un grupo de personas a través de Internet), la página Virtual hosts todavía ofrece la misma característica. También el módulo Nextcloud podría ser un buen sustituto.

  3. Si el contenido ibay era accesible con una URL como http://<IP>/ibayname, el procedimiento más sencillo para mantenerlo funcionando es trasladarlo a la raíz del documento Apache:

    mv -iv /var/lib/nethserver/ibay/ibayname /var/www/html/ibayname
    chmod -c -R o+rX /var/www/html/ibayname
    db accounts delete ibayname
    signal-event nethserver-samba-update
    

After migration, ibays will retain a backward compatibile profile. To take advantage of new features, including Samba Audit, the ibay configuration must be switched to the new profile. From command line execute:

db accounts setprop ibay_name SmbProfileType default
signal-event ibay-mody ibay_name

Where ibay_name is the name of the ibay to configure.

Migration from backup

  1. En el host de origen, cree un archivo de copia de seguridad completo y muévalo al host de destino.

  2. In the destination host, install NethServer 7 using the most recent ISO, register it then apply all the latest core updates available.

  3. In the destination host, install all packages that cover the same features of the source.

  4. Descargar el archivo de copia de seguridad completo en algún directorio; Por ejemplo, cree el directorio /var/lib/migration.

  5. En el host de destino, señale el evento migration-import:

    signal-event migration-import /var/lib/migration
    

    Este paso requerirá algún tiempo.

  6. Compruebe si hay algún mensaje de error en /var/log/messages:

    grep -E '(FAIL|ERROR)' /var/log/messages
    

Migration with rsync

The process is much faster than migrating from a backup.

Before starting make sure to have:

  • a running NethService/SME installation, we will call it original server or source server

  • a running NethServer 7 installation with all the latest updates installed and at least the same disk space of the source server, we will call it destination server

  • a working network connection between the two severs

Please also make sure the source server allows root login via SSH key and password.

Sync files

The synchronization script copies all data using rsync over SSH. Files are saved inside /var/lib/migration directory. If the destination server doesn’t have any SSH keys, the script will also create a pair of RSA keys and copy the public key to the source server. All directories excluded from the backup data will not be synced.

On the target machine, execute the following command:

screen rsync-migrate <source_server_name> [ssh_port]

Where

  • source_server_name is the host name or IP of the original server

  • ssh_port is the SSH port of the original server (default is 22)

Example:

screen rsync-migrate mail.nethserver.org 2222

When asked, insert the root password of the source server, make a coffee and wait patiently.

The script will not perform any action on the source machine and can be invoked multiple times.

Sync and migrate

If called with -m option, rsync-migrate will execute a final synchronization and upgrade the target machine.

Before executing the final migration, install all packages that cover the same features of the source.

Example:

screen rsync-migrate -m mail.nethserver.org 2222

The script will:

  • stop every service on the source machine (except for SSH)

  • execute the pre-backup event on the source machine

  • sync all remaining data

  • execute the migration-import event on the destination machine

At the end, check for any error message in /var/log/messages:

grep -E '(FAIL|ERROR)' /var/log/messages