Fortinet white logo
Fortinet white logo

CLI Reference

backup

backup

Use this command to back up the configuration file and data to an FTP, TFTP, or SCP (copy over SSH) server, or to the local FortiMail system's hard disk.

execute backup config commands only back up settings that can be configured via CLI and stored in a CFG file, and do not include other data that may be stored separately, such as mail queues, IBE-encrypted email, and settings in email users' preferences, personal safe/block lists, and secondary email addresses.

execute backup full-config commands, in addition to the CFG file, do include the data that is stored separately. All are packaged together in a TGZ archive. (Alternatively, you can back up the separate data individually, with commands such as execute backup mail-queues.) Before backing up, you must export IBE and user data files so that they can be included in the archive. See user-config and ibe data.

Tooltip

execute backup full-config commands do not include all data that can be backed up via the FortiMail GUI, and does not include webmail mailboxes. See backup-restore.

Syntax

execute backup full-config ftp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup full-config scp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup full-config tftp <file-name_str> <server_ipv4>[ <file-password_str>]

execute backup config local

execute backup config ftp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup config scp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup config tftp <file-name_str> <server_ipv4>[ <file-password_str>]

execute backup mail-queues <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup mail-queues scp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup mail-queues tftp <file-name_str> <server_ipv4>[ <file-password_str>]

execute backup ibe-data <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup ibe-data scp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup ibe-data tftp <file-name_str> <server_ipv4>[ <file-password_str>]

execute backup user-data <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup user-data scp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup user-data tftp <file-name_str> <server_ipv4>[ <file-password_str>]

Example

This example tries to upload a password-encrypted backup to an SCP server. The exported user data file has not been updated recently, and the IBE data has not been exported first, and so FortiMail prompts you to confirm if you want to continue. The connection then also fails because the FortiMail system is configured to authenticate with a password, but the server currently requires an SSH public key.

execute backup full-config scp fortimail_backup.tgz 172.16.1.10:22 backup-user P@ssword1 Q+zFn#T)k*5sh=7

User defined configuartion can be updated with command "exec user-config generate".

User defined configuration last updated time: Wed May 27 06:49:15 2026

IBE data can be updated with command "execute ibe data export-to-file".

No IBE data available

Do you want to continue? (y/n)y

System time: Wed May 27 10:05:25 2026

Backup with current user defined configuration and no ibe data. Do you want to continue? (y/n)y

backup-user@172.16.1.10: Permission denied (publickey).

/bin/scp: Connection closed

scp: No such file or directory

Related topics

restore config

user-config

ibe data

system checkused

backup

backup

Use this command to back up the configuration file and data to an FTP, TFTP, or SCP (copy over SSH) server, or to the local FortiMail system's hard disk.

execute backup config commands only back up settings that can be configured via CLI and stored in a CFG file, and do not include other data that may be stored separately, such as mail queues, IBE-encrypted email, and settings in email users' preferences, personal safe/block lists, and secondary email addresses.

execute backup full-config commands, in addition to the CFG file, do include the data that is stored separately. All are packaged together in a TGZ archive. (Alternatively, you can back up the separate data individually, with commands such as execute backup mail-queues.) Before backing up, you must export IBE and user data files so that they can be included in the archive. See user-config and ibe data.

Tooltip

execute backup full-config commands do not include all data that can be backed up via the FortiMail GUI, and does not include webmail mailboxes. See backup-restore.

Syntax

execute backup full-config ftp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup full-config scp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup full-config tftp <file-name_str> <server_ipv4>[ <file-password_str>]

execute backup config local

execute backup config ftp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup config scp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup config tftp <file-name_str> <server_ipv4>[ <file-password_str>]

execute backup mail-queues <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup mail-queues scp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup mail-queues tftp <file-name_str> <server_ipv4>[ <file-password_str>]

execute backup ibe-data <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup ibe-data scp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup ibe-data tftp <file-name_str> <server_ipv4>[ <file-password_str>]

execute backup user-data <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup user-data scp <file-name_str> {<server_fqdn> | <server_ipv4> | <server_ipv6>}[:<port_int][ <server-user_str> <server-password_str>[ <file-password_str>]]

execute backup user-data tftp <file-name_str> <server_ipv4>[ <file-password_str>]

Example

This example tries to upload a password-encrypted backup to an SCP server. The exported user data file has not been updated recently, and the IBE data has not been exported first, and so FortiMail prompts you to confirm if you want to continue. The connection then also fails because the FortiMail system is configured to authenticate with a password, but the server currently requires an SSH public key.

execute backup full-config scp fortimail_backup.tgz 172.16.1.10:22 backup-user P@ssword1 Q+zFn#T)k*5sh=7

User defined configuartion can be updated with command "exec user-config generate".

User defined configuration last updated time: Wed May 27 06:49:15 2026

IBE data can be updated with command "execute ibe data export-to-file".

No IBE data available

Do you want to continue? (y/n)y

System time: Wed May 27 10:05:25 2026

Backup with current user defined configuration and no ibe data. Do you want to continue? (y/n)y

backup-user@172.16.1.10: Permission denied (publickey).

/bin/scp: Connection closed

scp: No such file or directory

Related topics

restore config

user-config

ibe data

system checkused