Skip to end of metadata
Go to start of metadata

There is currently a problem when upgrading FileWave on UCS version 4.2. Since this is a problem with UCS, not FileWave, a workaround for it has been found which this KB article will walk you though.

Issue

The problem is that the data_folder which contains the files of all Filesets in FileWave is wiped out during an upgrade. Below are the cases in which you will encounter this bug:

  • FileWave [12.3.0, 12.7.0] is installed in UCS 4.2-*
  • FileWave [12.3.0, 12.7.0] was originally installed on UCS 4.2-*, but UCS has been updated to version 4.3+

In either of these cases you can see that the data files are removed from /fw directory in UCS server virtual machine.


Solutions

READ BEFORE UPGRADING

Make sure that no devices connect to the server while the server data is empty. Having your enrolled devices connected to temporarily empty server may have negative consequences, including device un-enrollement. Preferred way to prevent this is to block all traffic on ports 20015, 20017, 20443 and 20445 on your firewall during the upgrade.

The solution is:

When upgrading FileWave, only the data_folder is wiped out, the solution is to simply back up this folder "/fw/data_folder" before upgrading FileWave, upgrade FileWave, stop FileWave server, restore data_folder to /fw directory and then start FileWave again. Below is a simple script which can be used to automate this process:

  • Download Script: fw-ucs-upgrade-script.sh.zip
  • Make sure script is executable using chmod a+x
  • You can run the script without specifying a version and it will default to the newest, or you can add a version when launching the script show below. (Example is 12.8.1)

    Launch Upgrade Script With Version
    sudo ./fw-ucs-upgrade-script.sh 12.8.1

Below is the contents of the fw-ucs-upgrade-script.sh that you will need to launch above.

#!/usr/bin/env bash
set -e
 
 
 
if [ -z "$1" ];
then
    echo "no version specified. upgrading to latest version..."
    TARGET_VERSION=''
else
    TARGET_VERSION=$1
fi
 
 
CURRENT_VERSION=$(sudo univention-app get --values-only filewave version)
 
echo "Back up data_folder..."
sudo univention-app stop filewave
sudo cp -R /fw/data_folder /opt/
 
echo "Starting upgrade..."
sudo univention-app upgrade --noninteractive filewave=$TARGET_VERSION  || retValue=$?
 
echo "Restoring data files..."
#make sure FileWave is not running
sudo univention-app stop filewave
sudo cp -R /opt/data_folder /fw/
sudo univention-app start filewave
sudo rm -rf /opt/data_folder
 
UPDATED_VERSION=$(sudo univention-app get --values-only filewave version)
if [[ -n $retValue ]] || [ "$CURRENT_VERSION" == "$UPDATED_VERSION" ];
then
    echo "Upgrade did NOT finish successfully."
    exit $retValue
fi
 
echo "FileWave has upgraded to version $UPDATED_VERSION successfully."