Upgrade to EMG 7.2

Given an existing EMG 7.1 installation, the following steps provide an upgrade to EMG 7.2. This can be done in multiple phases, and requires an active support agreement with an updated license file. All commands should be run as the user “emg”, or the non-root user used for the EMG installation.


Everything in this section can be done in advance, without disturbing the existing installation.

  1. Add BACKEND=TC in the top part of the server.cfg file. This ensures EMG 7.2 will use the existing storage backend, in case you want to downgrade back to EMG 7.1.
  2. Do not add DLR_TO_SAME_IP yet.
  3. Make sure the current emgd binary is called emgd-7.1.x-nnnnn or something similar, where x and nnnnn matches the output from “emgd -v”.
  4. Download the new EMG binaries, and unpack them in a new directory.
  5. Copy the new binaries into the bin directory, renaming them from emgXXX into emgXXX-7.2.0-50785, again using the exact version information from “emgd -v” from the new binary.
  6. Copy emgclient, emgd, emgload, emgpdu, emgsend, emgsink and emgstat into the same format emgXXX-7.1.n-nnnnn, using the old version information.
  7. You can run “emgd -upgradesql” to see the optional database schema updates.
  8. Check the output from “ulimit -a”. The number of open files must be at least twice the total number of connector instances. If this is not the case, run “ulimit -n” to change it. Please also add that command to the /etc/rc.local file, before it starts the EMG Watchdog.

Starting the new version

  1. Remove emgclient, emgd, emgload, emgpdu, emgsend, emgsink and emgstat, and replace them with symbolic links to the new binaries. Each binary requries a command such as the one below.
    • rm -f emgd ; ln -s emgd-7.2.0-50785 emgd
  2. Kill the EMG Watchdog processes.
  3. Copy all the remaining EMG binaries to $EMGDIR/bin.
  4. Run “emgd -stop” to stop the currently running emgd.
  5. Run “emgd”.
  6. Check the log/general for any warnings or errors, and make any necessary adjustments.
  7. Check the output from “emgstat”.
  8. Restart the EMG Watchdog, using the same command as in /etc/rc.local.

Now you use the new features such as “emgstat –nz” to see only connectors with traffic, and “emgstat –plugin” to see a list of configured plugins and their activity.

Downgrade to EMG 7.1

If there are any significant issues, it is possible to downgrade back to version by simply changing the “emgXXX” symbolic links, pointing to the 7.1 versions. Then run “emgd -stop ; emgd”.

The 7.2 tools are backwards compatible with 7.1, so you only need to change “emgd”.

Committing to EMG 7.2

At some point in the future, you may want to commit to the new version. After these steps, going back to 7.1 is more difficult.

  1. To upgrade the database schema, first make a copy of the existing EMG database. This makes it possible to see the time required to run the commands given by “emgd -upgradesql”.
  2. If the time spent is not acceptable, the upgrade may need to be done in multiple steps. Please consult with your local database administrator.
  3. Comment out the BACKEND line in the server.cfg.
  4. Now you may set DLR_TO_SAME_IP on the relevant connectors, if needed.
  5. Change the database sections to use the new format: ADDRESS=username:password@host:port/dbname. This makes it possible to multiple ip’s for the same database profile.
  6. Run “emgd -stop”.
  7. Update the database schema, either by running the commands shown earlier, or by running “emgd -upgradedb”.
  8. Run “emgd”.

The existing data will be read from the old files, but everything new will be stored in the new format. These new files are stored in $EMGDIR/spool/leveldb, and the old files are removed automatically when they are empty.