Fleio Safe Upgrade

When upgrading an existing Fleio installation used in production we recommend you use the following upgrade steps in order to avoid/troubleshoot possible issues:

1. Disable process clients cron

Process client cron is a cron job or periodic celery beat task that processes all clients at repeated intervals and updates client usage, suspends and resume services and so on …

Prior to version 2020.05.0 process clients cron was run as a cron job. Starting from version 2020.05.0 process clients cron is run as a celery beat periodic task. You should disable both since this is documentation is added with 2020.05.0 release.

Disabling the cron job: - edit /var/webapps/fleio/scripts/process_clients_cron and comment out the line containing /var/webapps/fleio/scripts/process_clients_cron by placing a # character at the beginning - wait for any running cron to finish

Disabling the celery beat periodic task: - edit /var/webapps/fleio/project/fleio/fleiosettings/settings.py and add the following line at the end

Note that you should disable any other fleio crons that you are using.

CELERY_BEAT_SCHEDULE = {}

2. Wait for any running cron processes to finish

This applies to Fleio installations up to 2020.04.3

ps -ef | grep cron

For process client periodic tasks you will need to check in activity log to ensure the task is completed.

3. Create a backup of your Fleio database

This is needed to restore Fleio in case something goes wrong with the update.

4. Create a backup of Fleio file

This is needed to restore Fleio in case something goes wrong with the update. Go to /var/webapps/ and execute

tar -zcvf fleio.2020.03.tar.gz fleio

5. Update Fleio installation

Update Fleio installation using the package managed on the Fleio machine.

6. Check data in Fleio after upgrade

Check data in Fleio to ensure everything is correct after upgrade. Check clients, services, products, client usage and so on until you are satisfied everything is ok.

7. Run process clients on a few clients

Process clients can now be run for specified clients bu using -c arg

cd /var/webapps/fleio/scripts && ./process_clients_cron -c CLIENT_ID

You can use multiple client ids separated by comma.

We recommend to test on a few clients with multiple scenarios like: service is active and it does have credit, service is active but with negative balance, service is suspended, service is terminated and so on. After each run of the cron check to see if the specified clients to see that everything went as expected(check client credit, usage, services …).

8. Enable process clients periodic task

If everything went ok you can enable the process clients cron periodic task by removing the

CELERY_BEAT_SCHEDULE = {}

line from settings.py. Note that this line overrides CELERY_BEAT_SCHEDULE setting in base_settings.py. If you want to fine tune periodic tasks or enable more than process clients periodic task you should copy that setting to settings.py and modify it.

Note that if you prefer to use cron jobs you should leave this line in settings.py and enable cron.