========= Upgrading ========= In this page, you can do as follow: .. contents:: :local: :depth: 2 .. _how-to-upgrade-docker: How to upgrade (docker installation) ==================================== .. important:: This method works only when you have Fleio installed using the :ref:`docker deployment method`. When upgrading Fleio we always recommend you to follow the :ref:`safe_upgrade_docker` procedure. To upgrade Fleio to the latest version you need to run the following command: .. code-block:: bash fleio upgrade If you want first to check what versions are available you need to run the following command: .. code-block:: bash fleio updates If you want to also check for beta versions, you can use the --include-beta (-b) flag: .. code-block:: bash fleio updates --include-beta fleio upgrade --include-beta If you want to upgrade to a certain version, you need to pass the Fleio version. First you should check what versions are available for upgrade: .. code-block:: bash $ fleio updates --include-beta Creating fleio_utils_run ... done Current version: 2021.01.2 Available updates: 2021.03.1 2021.03.0 2021.02.1 2021.02.0 Then you can run the upgrade command using the desired Fleio version: .. code-block:: bash $ fleio upgrade 2021.02.1 .. _safe_upgrade_docker: Recommended upgrade procedure ----------------------------- .. important:: This method works only when you have Fleio installed using the :ref:`docker deployment method`. This procedure works only with Fleio 2020.02 or later. 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 periodic tasks ~~~~~~~~~~~~~~~~~~~~~~~~~ Disable periodic tasks in the new installation by **adding this at the end of** ``settings.py``: .. code-block:: python sudo -i -u fleio fleio edit settings.py CELERY_BEAT_SCHEDULE = {} After you edit settings.py file you will be asked to restart fleio services. Please answer with "n". For the moment we will restart only the celerybeat container: .. code-block:: bash docker restart fleio_celerybeat_1 The next step is to check if there's any periodic tasks running. You can do that by running the following commands: .. code-block:: bash fleio list periodic If the output of the command is empty, then it means that there are no periodic tasks running and you can continue with the next step. If the output is listing a periodic task, then you need to wait for that task to finish. 2. Backup database ~~~~~~~~~~~~~~~~~~ In order to backup your database, you will have to run the following commands: .. code-block:: bash # we assume you're already under the fleio user, after previously running sudo -i -u fleio # get the database password in a variable cd /home/fleio/compose db_pass=$(cat /home/fleio/compose/secrets/.db_password) docker-compose exec -T db mysqldump fleio -u fleio -p"$db_pass" > fleio`date +%d.%m.%Y`.sql 3. Upgrade Fleio ~~~~~~~~~~~~~~~~ Please see :ref:`how-to-upgrade-docker` 4. 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. 5. Run process clients on a few clients ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash fleio bash /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 ...). 6. 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`. .. code-block:: python fleio edit settings.py # remove this line: CELERY_BEAT_SCHEDULE = {} This time you can answer with "y" when asked to restart fleio services. If you want to fine tune periodic tasks or enable more than process clients periodic task please see :ref:`celery_beat_tasks_schedule`. .. _how-to-upgrade-package: How to upgrade (package installation) ====================================== .. important:: This method works only when you have Fleio installed using system packages. We recommend you to migrate to docker (see :doc:`/operating/migrate-to-docker`) as soon as possible. When upgrading Fleio we always recommend you to follow the :ref:`safe_upgrade_packages` procedure. To upgrade Fleio just use the system package manager. Some Fleio versions upgrade requires additional steps. See sections below. Ubuntu ------ :: apt-get update apt-get dist-upgrade fleio-backend fleio-frontend Centos ------ :: yum clean all yum update fleio-backend fleio-frontend .. _safe_upgrade_packages: Recommended upgrade procedure ----------------------------- .. important:: This method works only when you have Fleio installed using system packages. We recommend you to migrate to docker (see :doc:`/operating/migrate-to-docker`) as soon as possible. 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. .. code-block:: python CELERY_BEAT_SCHEDULE = {} Restart celerybeat: .. code-block:: bash systemctl restart celerybeat 2. Wait for any running cron processes to finish ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This applies to Fleio installations up to 2020.04.3 .. code-block:: bash 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 .. code-block:: bash tar -zcvf fleio.2020.03.tar.gz fleio 5. Upgrade Fleio installation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Upgrade 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 .. code-block:: bash 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 .. code-block:: python 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 please see :ref:`celery_beat_tasks_schedule`. Note that if you prefer to use cron jobs you should leave this line in settings.py and enable cron. .. _upgrade-2022.04: Upgrading to 2022.04 ==================== In the 2022.04 release we have upgraded the Fleio backend dependencies. With this upgrade, we also moved to django 4.0, where `PASSWORD_RESET_TIMEOUT_DAYS` setting was removed. If you're aware that you changed the `PASSWORD_RESET_TIMEOUT_DAYS` time by redefining the variable in your settings.py, then you need to remove it and use the `PASSWORD_RESET_TIMEOUT` variable. Note that the new variable uses seconds while the old one used days. If you're using the `CSRF_TRUSTED_ORIGINS` setting, then you will need to also include the scheme (`http://` or `https://`) .. _upgrade-2021.12.0: Upgrading to 2021.12 ==================== In the 2021.12 release we have changed the `utils` menu option to `utilities`. If you redefined the Fleio menu in settings.py, you will have to rename all `utils/xxx` angular_route parameters to `utilities/xxx`. .. _upgrade-2021.11.0: Upgrading to 2021.11.0 ====================== In the 2021.11.0 release we have removed the "state" parameter from the MenuItem classes in their definition of menu in settings.py. If you redefined the Fleio menu in settings.py, you will have to remove all traces of the 'state' parameter. For example, Networks menu changed from: .. code-block:: python MenuItem(label=_('Networks'), state='openstackNetworks', icon='networks', feature='openstack.networks', angular_route='openstack/networks', related_permission='networks.list'), to .. code-block:: python MenuItem(label=_('Networks'), icon='networks', feature='openstack.networks', angular_route='openstack/networks', related_permission='networks.list'), Another thing that was removed in the 2021.11.0 release is "minTTL" frontend setting. In order to configure a minimum TTL you need to add the following variable in the settings.py: .. code-block:: python DNS_ENDUSER_MIN_TTL = 300 Replace ``300`` with the desired value. In 2021.11.0 we also added a new dark theme. For existing installations, you will have to manually add the theme in the enduser, staff and reseller panels, by running the following commands: .. code-block:: bash fleio edit enduser.config.json fleio edit staff.config.json fleio edit reseller.config.json Then, in the ``availableThemes`` list, add "dark": .. code-block:: python "availableThemes": [ "spring", "navy", "dusk", "dark" ], .. _upgrade-2021.10.1: Upgrading to 2021.10.1 ====================== In the 2021.10.1 release we have added new filters and modifiers. If you're upgrading from a previous Fleio version, then you will not be able to configure them until you will add the new filters and modifiers into Fleio. First, you will have to enable django admin. Please see :ref:`enable_django_admin`. Next step is to access the django admin, which should be available at {{ your configured frontend url }}/backend/admin If you are asked to login, then you will have to use your administrator credentials. Navigate to Billing app -> billing resources -> Instance and in the `definition` field, replace all it's contents with the one from below (has_boot_volume is the new entry that was added). .. code-block:: python { "attributes": [ { "type": "string", "name": "availability_zone" }, { "type": "string", "name": "instance_type" }, { "type": "string", "name": "display_name" }, { "type": "datetime", "name": "launched_at" }, { "type": "string", "name": "state" }, { "type": "integer", "name": "vcpus" }, { "type": "integer", "name": "root_gb", "value_size": "g" }, { "value_size": "m", "name": "memory_mb", "type": "integer" }, { "type": "string", "name": "os_type" }, { "type": "string", "name": "instance_id" }, { "type": "string", "name": "tenant_id" }, { "type": "string", "name": "host" }, { "type": "string", "name": "has_boot_volume" }, { "type": "integer", "name": "ephemeral_gb", "value_size": "g" }, { "type": "string", "name": "region" } ] } Save and navigate to Billing app -> billing resources -> Volume and in the `definition` field replace the contents with the following (related_instance_flavor new entry was added): .. code-block:: python { "attributes": [ { "value_size": "g", "type": "integer", "name": "size" }, { "type": "string", "name": "availability_zone" }, { "type": "datetime", "name": "created_at" }, { "type": "string", "name": "volume_type" }, { "type": "string", "name": "related_instance_flavor" }, { "type": "string", "name": "display_name" }, { "type": "string", "name": "region" } ] } Pre 2021.01.0 ============= .. _upgrade-2020-12-1: Upgrading to 2020.12.1 ---------------------- .. important:: This method works only when you have Fleio installed using system packages. We recommend you to migrate to docker (see :doc:`/operating/migrate-to-docker`) as soon as possible. In 2020.12.1 we have added the enduser panel in Angular and support for Swift object store. In order to enable Swift object store you need enable the Angular enduser panel so you will need to add the following configuration in the Nginx configuration: .. code-block:: bash location /new { alias /var/webapps/fleio/frontend/enduser/; expires -1; try_files $uri $uri/ /../enduser/index.html; } Finally do not forget to reload nginx using the following cli commands: .. code-block:: bash nginx -t systemctl reload nginx .. _upgrade-2020-11-1: Upgrading to 2020.11.1 ---------------------- .. important:: This method works only when you have Fleio installed using system packages. We recommend you to migrate to docker (see :doc:`/operating/migrate-to-docker`) as soon as possible. With the 2020.11.1 upgrade we have implemented a new log level called FLEIO ACTIVITY and we have redesigned the general logging. Before upgrading to the 2020.11.1 version you will have to check `/var/webapps/fleio/fleiosettings/settings.py` to be sure that you have no custom logging setting added. You can do that by running the following command: .. code-block:: bash grep LOGGING /var/webapps/fleio/fleiosettings/settings.py If you have any results, you will need to comment or remove those lines. After that you can proceed with the :ref:`safe_upgrade_packages`. However, if you already upgraded and you received an error related to Logging, you can just do the steps from above and then run the update commands again. .. _upgrade-2020-07-1: Upgrading to 2020.07.1 ---------------------- .. important:: This method works only when you have Fleio installed using system packages. We recommend you to migrate to docker (see :doc:`/operating/migrate-to-docker`) as soon as possible. New nginx configuration ~~~~~~~~~~~~~~~~~~~~~~~ In 2020.07.1 we have added the Tickets plugin in Angular. In order to properly work you need to add the following tinymce configuration in the Nginx configuration: .. code-block:: python location /tinymce { alias /var/webapps/fleio/frontend/staff/tinymce/; break; } Finally do not forget to reload nginx using the following cli commands: .. code-block:: bash nginx -t systemctl reload nginx .. _upgrade-2020-05: Upgrading to 2020.05.0 ---------------------- .. important:: This method works only when you have Fleio installed using system packages. We recommend you to migrate to docker (see :doc:`/operating/migrate-to-docker`) as soon as possible. To upgrade to version 2020.05.0 on Ubuntu 16 and Ubuntu 18 first you will need to run: .. code-block:: bash apt-get dist-upgrade fleio-backend fleio-frontend This is necessary due to a new dependency (patch) that was introduced in 2020.05 release. The regular ``apt-get upgrade fleio-backend fleio-frontend`` command will not install the dependency and you might get in a state that fleio-frontend is not automatically upgraded. To upgrade to version 2020.05.0 on Centos you need to run: .. code-block:: bash yum install fleio-backend fleio-frontend Besides this, the following additional steps are required. We are migrating the Fleio frontend from the legacy AngularJS framework to Angular. For a smooth migration we are gradually rewriting and releasing pages from the staff panel in Angular. After the staff panel is successfully migrated to Angular we will do the same for the end-user panel. This is expected to take several months. The new Angular pages are temporarily located a under the ``/newstaff`` URL, while the previous pages remain for now under ``/staff`` URL. New nginx settings ~~~~~~~~~~~~~~~~~~ By default some of the staff panel menu options already point to ``/newstaff`` links, while the pages that are not yet migrated to Angular will still link to a ``/staff`` URL. For instance, one of the first pages migrated to Angular is **Settings** > **Configurations** and it links to ``/newstaff/settings/configurations``. This requires that you add a new entry to your nginx conf, which is usually located at for Ubuntu at ``/etc/nginx/sites-enabled/{ your domain }.conf`` and for CentOS at ``/etc/nginx/conf.d/{ your domain }.conf.`` Add this entry in the ``server`` configuration after the ``/staff`` location. .. code-block:: bash # identify the following section and leave it unchanged location /staff { alias /var/webapps/fleio/frontend/site/staff/; expires -1; try_files $uri $uri/ /staff/index.html; } # insert below the following lines location /newstaff { alias /var/webapps/fleio/frontend/staff/; expires -1; try_files $uri $uri/ /../staff/index.html; } Reload nginx to apply the change: .. code-block:: bash systemctl reload nginx If you have enabled the reseller feature an additional change is required in the nginx config. Replace this section: .. code-block:: bash # identify these section and delete it location /reseller { root /var/webapps/fleio/frontend/site/; expires -1; try_files $uri $uri/ /reseller/index.html; } Replace with: .. code-block:: bash # the new reseller directives location /reseller { alias /var/webapps/fleio/frontend/reseller/; expires -1; try_files $uri $uri/ /../reseller/index.html; } Reload nginx to apply the change: .. code-block:: bash systemctl reload nginx New menu definition ~~~~~~~~~~~~~~~~~~~ If you previously changed the menu in ``constants.js`` file, see https://fleio.com/docs/2022.04.1/configuring/frontend-settings.html#new-menu-definition-1