Migrating from RPM Deployment
This chapter explains how to migrate from an existing RPM-based deployment of the BWGW to its containerized version. Since most of the configuration is stored in the database, this section focuses on recovering the necessary settings from configuration files. When the container starts, it reads from the same database, ensuring a smooth transition.
DANGER
Ensure that the same version of the BWGW is used in both the Docker and RPM variants, as the software executes DB migration scripts when version discrepancies occur. Switching versions during migration should be avoided. The software version can be updated later by adjusting the image reference in the docker-compose.yml
file.
The container can be launched either on the same host as the current RPM gateway (to be decommissioned later) or on a new host. If deployed on the same host, both versions must not run simultaneously unless they are exposed on different ports.
During the RPM-based installation of the APIO Broadworks Gateway, an initial configuration file with an .ini
extension was created under /opt/apio-gateway_frontend/apio-gateway-ops/
. This file served as the basis for generating various configuration files.
To transition from the RPM-based installation to a container-based deployment, the configuration parameters must be extracted from the existing setup and used to define the BWGW*
environment variables in the docker-compose.yml
file.
These parameters can be retrieved in two ways:
- From the original
.ini
file created during the initial installation, if it is still available or stored in a safe location. - From the current BWGW configuration files if the
.ini
file is no longer accessible.
The next two chapters outline both methods in detail.
Retrieving Parameters from INI File
Read the .ini
file located in the /opt/apio-gateway_frontend/apio-gateway-ops/
directory and map its values according to the specified mapping table.
Container Parameter | INI Parameter |
---|---|
BWGW_LOG_LEVEL | log_level |
BWGW_DB_NAME | apio_db_name |
BWGW_DB_USERNAME | apio_db_user |
BWGW_DB_PASSWORD | apio_db_pwd |
BWGW_DB_HOST | apio_db_host |
BWGW_DB_PORT | apio_db_port |
BWGW_DB_RENTENTION | apio_db_audit_retention_months |
BWGW_NUM_PROCS | apio_nb_of_running_processes |
BWGW_SYSTEM_DEFAULT_DOMAIN | apio_system_default_domain |
BWGW_DEFAULT_DOMAIN | apio_default_domain |
BWGW_TIMEZONE | apio_default_timezone |
BWGW_COUNTRY_CODE | apio_country_code |
BWGW_AS_SYSTEM_USERNAME | apio_system_user_login |
BWGW_AS_SYSTEM_PASSWORD | apio_system_user_pwd |
BWGW_AS_SUPER_USERNAME | apio_super_user_login |
BWGW_AS_SUPER_PASSWORD | apio_super_user_pwd |
BWGW_DJANGO_ADMIN_USERNAME | apio_django_admin_user |
BWGW_DJANGO_ADMIN_PASSWORD | apio_django_admin_pwd |
BWGW_AS_IP | proq_main_server_ip |
BWGW_OCI_VERSION | proq_oci_version |
BWGW_XSI_VERSION | proq_xsi_version |
BWGW_NSOSS_VERSION | proq_nsOss_version |
Retrieving Parameters from Current Configuration Files
Locate the BWGW Supervisord service configuration file under /etc/supervisord.d
and extract the value of the DJANGO_SETTINGS_MODULE
environment variable from it.
[program:apio-gateway-1]
directory=/opt/apio-gateway_frontend/apio-gateway
user=django
command=/opt/apio-gw-core/bin/gunicorn apio_gateway_frontend.wsgi:application -b 127.0.0.1:8101 --timeout=60 --graceful-timeout=30 --workers=1 --threads=5 --log-level=DEBUG --access-logfile=/var/log/gunicorn/access-apio-gateway.log --error-logfile=/var/log/gunicorn/error-apio-gateway.log --user=django --group=django
autorestart=true
stdout_logfile=/var/log/supervisor/apio-gateway-1-stdout.log
stderr_logfile=/var/log/supervisor/apio-gateway-1-stderr.log
stdout_logfile_maxbytes=10000000
stdout_logfile_backups=5
stderr_logfile_maxbytes=10000000
stderr_logfile_backups=5
environment=PATH="/opt/apio-gw-core/bin",DJANGO_SETTINGS_MODULE="apio_gateway_frontend.settings.apio_gateway_settings"
stopsignal=KILL
stopasgroup=true
Interpret the value of DJANGO_SETTINGS_MODULE
as a relative path under /opt/apio-gateway_frontend/apio-gateway/
. Replace all dots (.
) with slashes (/
) and append .py
to form the full path to the configuration file.
Example: apio_gateway_frontend.settings.apio_gateway_settings
must be interpreted as /opt/apio-gateway_frontend/apio-gateway/apio_gateway_frontend/settings/apio_gateway_settings.py
This configuration file includes the values needed to set some of the docker-compose.yml
environment variables outlined in the Installation chapter.
Verify in the existing Django admin interface that the Backend configuration already includes all necessary data. If the configuration is present, you may skip the remainder of this chapter, as the data has already been successfully provisioned into the database.
Among its various parameters, it includes a reference to the proq
configuration file (parameter PROQ_SETTINGS
), as shown in the example below:
APIO_SPECIFIC_DATA.update({
'PROQ_SETTINGS' : '/proq/proq-32-58.cfg',
'SYSTEM_DEFAULT_DOMAIN': 'netaxis.cloud',
'DEFAULT_DOMAIN': 'netaxis.cloud',
'DEFAULT_TIMEZONE': 'Europe/Brussels',
'LOCAL_COUNTRY_CODE': 'BE',
})
Interpret the value of PROQ_SETTINGS
as a relative path under /opt/apio-gateway_frontend/apio-gateway/apio_gateway_frontend/
.
Example: /proq/proq-32-58.cfg
must be interpreted as /opt/apio-gateway_frontend/apio-gateway/apio_gateway_frontend/proq/proq-32-58.cfg
This configuration file includes the values needed to set the rest of the environment variables outlined in the Installation chapter.
INFO
While the BWGW retrieves certain configuration parameters from the proq
configuration file, any Broadworks configuration stored in the database takes precedence.
Container Setup
After retrieving the parameters using one of the previously described methods, you can proceed to construct the docker-compose.yml
file as outlined in the Installation chapter.
Once done initiate the container as described in the Installation chapter.
WARNING
Do not run the load-initial-data
or create-django-admin
commands as described in the installation chapter, since the provisioning data is already present in the existing database.