FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
Article Id 190263
When deploying a FortiGate-VM on public Cloud, the license type is determined (on-demand or BYOL) during deployment.
The license type is fixed for the VM's lifetime.

The image used to deploy the FortiGate-VM on the public cloud marketplace predetermines the license type.

This article describes how to migrate a FortiGate-VM instance between license types.

Migrating a FortiGate-VM instance from one license type to another requires a new deployment.

It is impossible to simply switch license types on the same VM instance.
However,  migrate the configuration between two VMs running as different license types is possible.
There are also FortiOS feature differences between on-demand and BYOL license types.
For example, a FortiGate-VM on-demand instance is packaged with Unified Threat Management protection and does not support VDOMs, whereas a FortiGate-VM BYOL instance supports greater protection levels and features depending on its contract.

To migrate FortiOS configuration to a FortiGate-VM of another license type.

1) Connect to the FortiOS GUI or CLI and back up the configuration. See Configuration backups.
2) Deploy a new FortiGate-VM instance with the desired license type. If deploying a BYOL instance, it is necessary to purchase a new license from a Fortinet reseller. Apply the license after deployment via the FortiOS GUI or bootstrap the license and configuration during initial bootup using custom data as described in Bootstrapping the FortiGate-VM at initial bootup using user data.
3) Restore the configuration on the FortiGate-VM instance that is deployed in 2). As with the license, inject the configuration during initial bootup. Alternatively, restore the configuration in the FortiOS GUI as described in Configuration backups is possible.
4) If an on-demand instance in 2) is deployed, register the license. To receive support for an on-demand license, register the license as described in Creating a support account.

Upgrade Path Tool.

Configure Backup.

Bootstrapping the FortiGate-VM at initial bootup using user data.