This upgrade makes some changes to the cdrs table, and "enswitch upgrade" may take some tens of minutes to run on larger systems.

Before upgrading

  1. Review the functional changes, and ensure that none will cause problems.
  2. If running Kamailio 3.X or 4.X, upgrade to Kamailio 5.2.
  3. If running MySQL 5.6 or earlier, upgrade to 5.7. This may require upgrading to a newer version of your Linux distribution.
  4. If running MariaDB 10.1 or earlier, upgrade to 10.2. This may require upgrading to a newer version of your Linux distribution.
  5. Review which configuration options for MySQL or MariaDB may require an adjustment. Examples of this are the general "sql_mode" option or the database replication options "relay-log" and "relay-log-index". For reference, please check the guidelines given for the database machines of new Enswitch installations or to configure replication if more than one MySQL server is used for Enswitch.
  6. If database is upgraded, follow this MySQL/MariaDB check list to make sure that the database service was upgraded properly.
  7. Delete any unnecessary CDRs using "enswitch cdrs_delete <days>", where <days> is the age of the oldest CDR you still need in days. Doing this reduces the time "enswitch upgrade" takes.

To upgrade

  1. On all machines, check out /opt/enswitch/4.0.
  2. On all machines, update the /opt/enswitch/current symlink.
  3. Enswitch servers with a compiled HTMLDOC version older than 1.8.30 can skip this step and will continue working fine (check /usr/src/ and htmldoc --version). On all servers with a compiled HTMLDOC version 1.8.30 or newer do:
    • For CentOS, RedHat or Fedora: yum install gnutls-devel
    • For Debian or Ubuntu: apt-get install libgnutls28-dev

    This is needed to properly handle links that use the HTTPS protocol when converting from HTML to PDF files.

    Reinstall HTMLDOC to ensure that it detects and uses the previously installed GnuTLS development library to handle HTTPS links, with this command:

    • enswitch install -u htmldoc
  4. On the primary database machine, do:
    • enswitch upgrade
  5. On all web server machines, edit /etc/apache2/sites-enabled/enswitch.conf (Debian based distributions) or /etc/httpd/conf.d/enswitch.conf (Redhat based distributions), and change:
    • All mentions of "/opt/enswitch/current/www" to "/opt/enswitch/current/web".
    • <Directory "/opt/enswitch/current/web/dist"> to <Directory "/opt/enswitch/current/web">.
  6. On all machines, do:
    • stat /proc/1/exe | grep systemd > /dev/null && systemctl daemon-reload # If using systemd reload init scripts
    • enswitch restart
  7. Test calls and the web interface.
  8. On the primary database machine, do:
    • enswitch after_upgrade