We wanted to migrate a FortiGate 140D-configuration to a FortiGate 140D-PoE.

To do this, you have to upgrade them to the same software level, so there are no unknown configuration directives. Then, get a configuration file from the old one:
System > Dashboard > Status > System Operation widget > Backup.

The backup is a configuration file with configuration directives, like you may know from devices by Cisco. You can see there, that every configuration on the GUI has a CLI command for it. On Fortinet devices, the CLI is the ground work for all the GUI tasks.
This even helps when troubleshooting something, since you can do something on the GUI and then just diff both configuration files.

Ok, back to our task. After you’ve pulled a backup from the old one, pull a backup from the new one. This does not seem to make any sense, but we’ll use a tiny bit of that configuration later.

Then, open the old configuration file in your favourite text editor. At the top, you’ll see a few lines, that seem commented out but they do have an effect:


Then, open the new configuration file and you can see, that this part differs (apart from the rest of the configuration, of course):


If you load the old configuration file into the new device, it will stop with a simple “Configuration file error”. You have to replace the top lines in the old file with the top lines from the new file. Then, everything should just run smoothly.