Fortinet black logo

New Features

Backing up and restoring configuration files in YAML format

Copy Link
Copy Doc ID 77966226-6996-11ec-bdf2-fa163e15d75b:787595
Download PDF

Backing up and restoring configuration files in YAML format

Configuration files can be backed up or restored on an FTP or TFTP server in YAML format (in addition to FortiOS format). Files formatted in YAML are easy to read and have a consistent model that supports generic tools.

To back up configuration files in YAML format:
# execute backup yaml-config {ftp | tftp} <filename> <server> [username] [password]
To restore configuration files in YAML format:
# execute restore yaml-config {ftp | tftp} <filename> <server> [username] [password]
Note

In FortiOS 7.2.4 and later, and 7.4.0 and later, use:

# execute restore config {ftp | tftp} <filename> <server> [username] [password]

Examples

To back up configuration files in YAML format to the TFTP server:
# execute backup yaml-config  tftp  301E.yaml 172.16.200.55
    Please wait...
    Connect to tftp server 172.16.200.55 ...
    #
    Send config file to tftp server OK.
To restore configuration files in YAML format to the FTP server:
# execute restore  yaml-config  ftp  301E-1.yaml 172.16.200.55 root sys@qa123456
    This operation will overwrite the current setting and could possibly reboot the system!
    Do you want to continue? (y/n) y
    Please wait...
    Connect to ftp server 172.16.200.55 ...
    Get config file from ftp server OK.
    File check OK.
    #
    The system is going down NOW !!

YAML configuration file example

The following is an example of output from a YAML configuration file:

vdom:
    - root:
global:
    system_global:
        alias: "FortiGate-301E"
        hostname: "FortiGate-301E"
        switch-controller: enable
        timezone: 04
        vdom-mode: multi-vdom
    system_accprofile:
        - prof_admin:
            secfabgrp: read-write
            ftviewgrp: read-write
            authgrp: read-write
            sysgrp: read-write
            netgrp: read-write
            loggrp: read-write
            fwgrp: read-write
            vpngrp: read-write
            utmgrp: read-write
            wanoptgrp: read-write
            wifi: read-write

Backing up and restoring configuration files in YAML format

Configuration files can be backed up or restored on an FTP or TFTP server in YAML format (in addition to FortiOS format). Files formatted in YAML are easy to read and have a consistent model that supports generic tools.

To back up configuration files in YAML format:
# execute backup yaml-config {ftp | tftp} <filename> <server> [username] [password]
To restore configuration files in YAML format:
# execute restore yaml-config {ftp | tftp} <filename> <server> [username] [password]
Note

In FortiOS 7.2.4 and later, and 7.4.0 and later, use:

# execute restore config {ftp | tftp} <filename> <server> [username] [password]

Examples

To back up configuration files in YAML format to the TFTP server:
# execute backup yaml-config  tftp  301E.yaml 172.16.200.55
    Please wait...
    Connect to tftp server 172.16.200.55 ...
    #
    Send config file to tftp server OK.
To restore configuration files in YAML format to the FTP server:
# execute restore  yaml-config  ftp  301E-1.yaml 172.16.200.55 root sys@qa123456
    This operation will overwrite the current setting and could possibly reboot the system!
    Do you want to continue? (y/n) y
    Please wait...
    Connect to ftp server 172.16.200.55 ...
    Get config file from ftp server OK.
    File check OK.
    #
    The system is going down NOW !!

YAML configuration file example

The following is an example of output from a YAML configuration file:

vdom:
    - root:
global:
    system_global:
        alias: "FortiGate-301E"
        hostname: "FortiGate-301E"
        switch-controller: enable
        timezone: 04
        vdom-mode: multi-vdom
    system_accprofile:
        - prof_admin:
            secfabgrp: read-write
            ftviewgrp: read-write
            authgrp: read-write
            sysgrp: read-write
            netgrp: read-write
            loggrp: read-write
            fwgrp: read-write
            vpngrp: read-write
            utmgrp: read-write
            wanoptgrp: read-write
            wifi: read-write