How to migrate from http:// to https://

Important

Migrating from http:// to https:// will require reinstalling Fleio and this implies downtime.

Your license will need to be refreshed two times during the migration process, so please open a ticket before starting the migration process.

Please follow the steps from below, in order to make the transition smoothly, while keeping all your data intact:

Save backend and frontend settings files

Important

We recommend you to save the backup files in a location that is outside of /home/fleio directory.

Run the following command to save the backend configuration file (settings.py) file:

echo "cat /var/webapps/fleio/project/fleio/fleiosettings/settings.py" | fleio bash > settings.py

Run the following commands to save the enduser panel (enduser.config.json) and staff (staff.config.json) panel configuration files:

echo "cat /var/webapps/fleio/frontend/enduser/assets/config/enduser.config.json" | fleio bash > enduser.config.json
echo "cat /var/webapps/fleio/frontend/staff/assets/config/staff.config.json" | fleio bash > staff.config.json

Warning

The reseller functionality in Fleio will be deprecated and removed from Fleio in the following months. We recommend that you do not use this feature any more.

If reseller is enabled, then you also need to save the reseller panel (reseller.config.json)configuration file:

echo "cat /var/webapps/fleio/frontend/reseller/assets/config/reseller.config.json" | fleio bash > reseller.config.json

Save the database

In order to save a database dump, we would recommend first to see if there are any periodic tasks running:

fleio list periodic

If there aren’t any, then you can safely stop Fleio (this is needed to ensure the data integrity):

sudo -i -u fleio
cd /home/fleio/compose
docker-compose stop
docker-compose start db
fleio mysqldump > fleio.sql

Save docker customizations

If you’ve made any changes to Fleio, by following the Adding or changing files in Fleio docker images guide, then you will have to save them. Copying the docker-compose.override.yaml and the the directories / files should be enough.

In normal circumstances, these customizations will not be lost upon reinstalling, but for extreme cases, it’s better to also save a backup of these customizations.

Uninstall Fleio

Warning

Commands below are permanently deleting Fleio.

In order to reinstall Fleio, you will first need to uninstall it:

fleio nuke

Install Fleio

Important

Make sure to reinstall the same Fleio version that you had. Installing a different version will break Fleio.

Before installing Fleio again, please let us know, so we can reset your license.

After you removed Fleio, you can install it again, by running the command from below:

curl -s -o install https://fleio.com/install && sudo bash install VERSION

When asked about the Fleio URL, you will have to use https:// protocol.

In the next step, you will be able to choose between a Let’s Encrypt SSL certificate or a self signed certificate. Choose the appropriate option for your case.

Import database form backup

Copy the fleio.sql file to /home/fleio/compose/fleio.sql and make sure the file has read permissions for the fleio user.

sudo chown fleio /home/fleio/compose/fleio.sql
sudo -i -u fleio
cd /home/fleio/compose
# stop all services
docker-compose stop
# and start just the database service
docker-compose start db
# get the database password in a variable
db_pass=$(cat /home/fleio/compose/secrets/.db_password)
# enter the mysql console
docker-compose exec db mysql -u fleio -p"$db_pass"
# once in console, drop the existing database and create a new one:
DROP DATABASE fleio;
CREATE DATABASE fleio CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# exit the console to Bash
exit
# import the database
cat fleio.sql | docker-compose exec -T db mysql fleio -u fleio -p"$db_pass"
#start fleio
docker-compose up -d

Restore backend and frontend settings files

Warning

After replacing the settings.py file, you will encounter fleio license related errors. Please contact our customer support team in order to reset your license.

fleio edit settings.py

Replace the full content of the new settings.py (which you should have in the editor after the above command) with the full content of the file from the backup you saved previously. After this, you will have to change the protocol for the FRONTEND_URL variable, from http:// to https://.

fleio edit enduser.config.json

Replace the full content of the new enduser.config.json file (which you should have in the editor after the above command) with the full content of the file from the backup you saved previously.

fleio edit staff.config.json

Replace the full content of the new staff.config.json file (which you should have in the editor after the above command) with the full content of the file from the backup you saved previously.

After having the license reset by one of our tech. support representatives, you will need to refresh the Fleio license:

fleio license --refresh

Test that migration was complete and Fleio is functioning properly

We recommend you to make sure that Fleio works properly (all panels are accessible via https://), and that your custom changes were properly applied. We also recommend you to do some smoke tests (e.g. create a new instance and see if it’s being updated in real time).

If you have any questions, feel free to contact us.