This guide will help you migrate your existing FlowFuse platform, created using version prior to 2.10.0,
to the new Docker Compose approach available since 2.11.0.
Version 2.10.0 introduced a new way to handle FlowFuse platform configurations. The new approach uses Compose configs to manage the configuration files and
volumes to manage data persistence. Additionaly, configuration can be adjusted using environmental variables with .env file.
This allows for easier management of the platform and better separation of concerns.
- access to existing installation files (run
docker compose lsto list project and path to it's configuration files) - access to configuration files:
./etc/flowforge.yml- FlowFuse configuration file./db- directory with database files./etc/flowforge-storage.yml- storage configuration file./certs- directory with custom certificates
-
Backup existing configuration files
Before starting the migration process, make sure to backup the existing configuration files. This will allow you to revert to the previous state in case of any issues.
cp ./etc/flowforge.yml ./etc/flowforge.yml.bak cp ./etc/flowforge-storage.yml ./etc/flowforge-storage.yml.bak cp -r ./db ./db.bak
-
Download new files
Download the new Docker Compose file and
.envfile from the FlowFuse repository.curl -o docker-compose-new.yml https://raw.githubusercontent.com/flowfuse/docker-compose/main/docker-compose.yml curl -o .env https://raw.githubusercontent.com/flowfuse/docker-compose/main/.env.example
-
Move configurations to the new approach
-
Copy content of
./etc/flowforge.ymlfile todocker-compose-new.ymlfile, toconfigs.flowfuse.contentsection. Remove all commented lines. Maintain indentation.- Make sure, that
broker.urlis seto fomqtt://broker:1883. Update if needed.
- Make sure, that
-
Copy content of
./etc/flowforge-storage.ymlfile todocker-compose-new.ymlfile, toconfigs.flowfuse_storage.contentsection. Remove all commented lines. Maintain indentation. -
Set the
DOMAINvariable in the.envfile to the domain used by your instance of FlowFuse platform. -
If FlowFuse application is running outside of the
DOMAINscope, set it as a value ofAPPLICATION_DOMAINvariable in the.envfile. -
If application should be accessible via seured connection (HTTPS), set
TLS_ENABLEDvariable totruein.envfile. -
If custom certificates are used, copy their content to
.envfile, toTLS_CERTIFICATEandTLS_KEYvariables. They should look like this:TLS_CERTIFICATE=" -----BEGIN CERTIFICATE----- MIIFfzCCBKegAwIBAgISA0 ... -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- MIIFfzCCBKegAwIBAgISA0 ... -----END CERTIFICATE----- " TLS_KEY=" -----BEGIN PRIVATE KEY----- MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD ... -----END PRIVATE KEY----- "
-
If custom certificates are used and FlowFuse application is running on a different domain than other stack components (defined in
APPLICATION_DOMAINvariable), useAPP_TLS_CERTIFICATEandAPP_TLS_KEYvariabls to provide certificate and it's key. They should look like this:
APP_TLS_CERTIFICATE="
-----BEGIN CERTIFICATE-----
MIIFfzCCBKegAwIBAgISA0
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIFfzCCBKegAwIBAgISA0
...
-----END CERTIFICATE-----
"
APP_TLS_KEY="
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD
...
-----END PRIVATE KEY-----
"-
Migrate database files
Move the database files from host to the new volume. This will allow you to keep the existing data.
- Create volume for database files:
docker volume create flowfuse_db
- Find currently running FlowFuse project and stop it:
docker compose ls docker compose -p $project down- Copy the database files to the new volume:
docker run --rm -v flowfuse_db:/data -v $(pwd)/db:/backup alpine sh -c "cp -a /backup/. /data/"
-
Rename files
In order to maintain the same file structurem, rename the compose files.
mv docker-compose.yml docker-compose-old.yml mv docker-compose-new.yml docker-compose.yml
-
Start FlowFuse
Start the new FlowFuse platform using the new Docker Compose file.
- With automatic TLS certificate generation:
docker compose -f docker-compose.yml --profile autotls -p flowfuse up -d
- In all other cases
docker compose -p flowfuse up -d
-
Verify the migration
Verify that the new FlowFuse platform is working correctly and it is accessible using the domain set in the
.envfile. Login credentials should remain the same as before the migration, as well as platform configuration. Restart the Node-RED instances if they appear inStartingstate.
8 Cleanup
After verifying that the new FlowFuse platform is working correctly, you can remove the old configuration files.
```bash
rm ./etc/flowforge.yml ./etc/flowforge.yml.bak
rm ./etc/flowforge-storage.yml.bak ./etc/flowforge-storage.yml
rm -rf ./db ./db.bak
rm -f ./docker-compose-old.yml
```