Filecloud Ubuntu OS Upgraded!

July 12, 2021

Steps to Upgrade Ubuntu 16.04 to 18.04 LTS Ubuntu 16.04 recently reached EOL, and some of the packages are no longer available in the repository. This creates an interesting challenge because those packages are necessary to run the upgrade. To upgrade an Ubuntu instance from 16.04 LTS to 18.04 LTS (where the Filecloud server is […]

Steps to Upgrade Ubuntu 16.04 to 18.04 LTS

Ubuntu 16.04 recently reached EOL, and some of the packages are no longer available in the repository. This creates an interesting challenge because those packages are necessary to run the upgrade.

To upgrade an Ubuntu instance from 16.04 LTS to 18.04 LTS (where the Filecloud server is running less than 21.1.x), follow the steps below:

Prior to running Ubuntu 16.04 LTS, you will need to back up the Filecloud server, as well as the  /var/www/html and /var/lib/mongodb paths. The chance of deleting this information during the OS upgrade is very high.

Run Backups:

  1. cp -rvf /var/www/html /var/www/html_backup
  2. cp -rvf /var/lib/mongodb /var/lib/mongodb_bkup

Perform Ubuntu Package Update:

Once the backups are complete, the next step is to perform the Ubuntu package update.

  1. apt-get update -y && apt-get upgrade -y
  2. apt-get dist-upgrade -y
  3. apt-get autoremove -y
  4. sudo reboot
  5. do-release-upgrade

NOTE: Select all the default options when prompted. Toward the end of the upgrade, you will need to restart your computer.

After Updating, Reinstall Packages:

After the upgrade is complete, you will need to reinstall certain packages, as the upgrade will have deleted them. To reinstall apache and php, please follow the steps below:

  1. LC_ALL=C.UTF-8 sudo add-apt-repository ppa:ondrej/php -y
  2. add-apt-repository ppa:ondrej/apache2 -y
  3. apt-get install unzip curl rsync python -y
  4. apt-get install apache2 build-essential libssl-dev pkg-config memcached -y
  5. apt-get install php7.2 php7.2-cli php7.2-common php7.2-dev php-pear php-dev php-zmq php7.2-zmq php7.2-json php7.2-opcache php7.2-mbstring php7.2-zip php7.2-memcache php7.2-xml php7.2-bcmath libapache2-mod-php7.2 php7.2-gd php7.2-curl php7.2-ldap php7.2-gmp php7.2-intl libreadline-dev php-pecl-http memcached php7.2-raphf php7.2-propro php7.2-mongodb php7.2-zmq -y
  6. a2enmod php7.2
  7. a2enmod headers
  8. a2enmod ssl
  9. apt-get -y install libmcrypt-dev
  10. cat <(echo "") | pecl install mcrypt-1.0.2 2>&1
  11. service apache2 status
  12. Retrieve files from the backup (the OS Ubuntu upgrade from v16 to v18 will have removed them)
  13. rsync -avz /var/www/html_backup/ /var/www/html/
  14. chown www-data:www-data /var/www/html -Rf

 

Is your FileCloud version greater or lesser than 20.2? Install the cronjob using these commands:
Greater than 20.2 echo "*/5 * * * * php / /var/www/html/src/Scripts/cron.php" | crontab -u www-data –
20.2 or less echo "*/5 * * * * php /var/www/html/core/framework/cron.php" | crontab -u www-data –

 

If the above cronjob command fails, please follow the below method to troubleshoot the cronjob. Then run the command again.

  1. Check if /etc/cron.allow ; if www-data is present:
  2. vim /etc/cron.allow // Add “www-data” if not present.
  3. crontab -e -u www-data // Make sure that the crontab editor pulls up if it does it will work. exit editor.
  4. crontab -u www-data -l

Set Up PHP CLI:

Now we will set up the PHP CLI.

  1. sudo update-alternatives --set php /usr/bin/php7.2
  2. sudo update-alternatives --set phar /usr/bin/phar7.2
  3. sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.2
  4. sudo update-alternatives --set phpize /usr/bin/phpize7.2
  5. sudo update-alternatives --set php-config /usr/bin/php-config7.2

Run the below command:

php -v // Make sure it shows the version to confirm it is working.
php -m // Make sure it shows the modules to confirm it is working

The expected output should be:

php -v

PHP 7.2.34-23+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Jul  1 2021 16:06:47) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.3.2, Copyright (c) 2002-2018, by ionCube Ltd.
with Zend OPcache v7.2.34-23+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

php -m

[PHP Modules]

bcmath

calendar

Core

ctype

curl

date

dom

exif

fileinfo

filter

ftp

gd

gettext

gmp

hash

iconv

intl

ionCube Loader

json

ldap

libxml

mbstring

mcrypt

memcache

mongodb

openssl

pcntl

pcre

PDO

Phar

posix

propro

raphf

readline

Reflection

session

shmop

SimpleXML

sockets

sodium

SPL

standard

sysvmsg

sysvsem

sysvshm

tokenizer

wddx

xml

xmlreader

xmlwriter

xsl

Zend OPcache

zip

zlib

zmq

 

[Zend Modules]

Zend OPcache

the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured)

 

Upgrade FileCloud:

Once Filecloud is reopened, you can run the Filecloud upgrade with this command:

If this command does not work, use:

 

Conclusion:

With the Ubuntu OS updated, FileCloud can work even better than before! The FileCloud support team is also available to provide assistance or answer questions.

 

Article written by Nandakumar Chitrasuresh

By Katie Gerhardt

Jr. Product Marketing Manager