Migration from CentOS7

Migrating OMniLeads from CentOS-7 🔄

Since the beginning of the Project, the installations have been based on CentOS7 operating systems. However, given its upcoming end-of-life date, the OMniLeads team has worked diligently to support modern operating systems such as _Ubuntu Server, Debian Server, Rocky Linux, among others

With the adoption of a container-based architecture and fully automated installation methods, IT administration and maintenance tasks have been significantly simplified due to the clear abstraction of underlying dependencies.

To achieve a correct migration from an OMniLeads instance on CentOS7 to its container-based architecture, it is necessary to perform a Fresh Install of OMniLeads on another host (or group of hosts, depending on the installation method involved). Ensure that the variables listed in the inventory.yml have the necessary correspondence with their counterparts on the CentOS7 instance. Specifically:

  • ami_user

  • ami_password

  • postgres_password

  • postgres_database

  • postgres_user

  • dialer_user

  • dialer_password

IMPORTANT: For the procedure, we must consider that the version of the Postgres image to be deployed with OMniLeads should be "omnileads/postgres:230624.01". Therefore, the following change should be added to the variable in groupvars_all/all inherent to the service:

#################### containers img tag  ################################

#postgres_img: docker.io/postgres:14.9-bullseye
postgres_img: docker.io/omnileads/postgres:230624.01

In OMniLeads on CentOS7, execute the following command to obtain the corresponding backup files. It is important to clarify that the resulting backup will be uploaded to the relevant Object Storage that the new OMniLeads instance used in its "fresh" deployment:

export NOMBRE_BACKUP=some_file_name
pg_dump -h ${PGHOST} -p ${PGPORT} -U ${PGUSER} -Fc -b -v -f /tmp/${NOMBRE_BACKUP}.sql -d ${PGDATABASE} --no-acl
export AWS_ACCESS_KEY_ID=$your_new_instance_bucket_key
export AWS_SECRET_ACCESS_KEY=$your_new_instance_bucket_secret_key
export S3_BUCKET_NAME=$your_new_instance_bucket_name

To migrate the information to an OMniLeads using the AIO installation method, export the S3_ENDPOINT variable as shown below: As we have seen in the Backups section, the goal is to restore the backups of custom audio, phone audio, database backups, etc., on the new OMniLeads deployment.

export S3_ENDPOINT=http://$OML_AIO_IP:9000 

For an OMniLeads installation using the AIT method (cluster), we export the S3_ENDPOINT variable as follows:

export S3_ENDPOINT=http://$OML_DATA_IP:9000 

If, on the other hand, you decide to use an External Object Storage, the data will need to be obtained from the corresponding provider:

export S3_ENDPOINT=https://$object_storage_url 

Finally, we proceed to upload all backups from OMniLeads on CentOS7 to the Bucket defined in the previous step.

aws --endpoint ${S3_ENDPOINT} s3 sync /opt/omnileads/media_root s3://${S3_BUCKET_NAME}/media_root
aws --endpoint ${S3_ENDPOINT} s3 sync /opt/omnileads/asterisk/var/spool/asterisk/monitor/ s3://${S3_BUCKET_NAME}
aws --endpoint ${S3_ENDPOINT} s3 cp /tmp/pgsql-backup-$NOMBRE_BACKUP.sql  s3://${S3_BUCKET_NAME}/backup/

Restoring your information

We need to modify the last two parameters of the inventory.yml file in our tenants' directory. This is necessary to indicate that the bucket does not manage reliable certificates and to configure the timestamp of the backup to be restored:

restore_file_timestamp: $NOMBRE_BACKUP 

By executing the following script with the action "restore," the previously taken backup will be reinstated on the newly deployed instance, thus creating a migrated environment.

./deploy.sh --action=restore --tenant=<tenant-folder>

Now, the original Postgres image must be restored, which involves resetting the content of group_vars/all to its previous state:

#################### containers img taf  ################################

postgres_img: docker.io/postgres:14.9-bullseye
#postgres_img: omnileads/postgres:230624.01

Finally, we run the upgrade:

./deploy.sh --action=upgrade --tenant=$your_inventory_folder_name

Configuration of Asterisk Dialplan

For official project repository, please visit the documentation provided in the repo. To make permanent modifications to the system (dialplan, scripts, specific configurations), it is recommended to use custom images. An example of how to achieve this is shown below.

OMniLeads is based on containers (images), so any code changes made within the container are "ephemeral".

Última actualización