Technical Tip: EMS Database Backup and Restore using EMSCLI
Description:
This article describes how to take a FortiClient EMS backup and store it on a remote server, as well as how to restore a backup stored on a remote server using the EMS CLI. This article shows the restoration of a single Default Tenant and not a multi-tenant EMS environment.
Scope:
- EMS v7.4.4+: Support for taking backups and restoring using EMSCLI added.
- EMS v7.4.5+: Support for backing up a specific tenant and restore DB for a specific Tenant is added.
Solution:
In this example, an OpenSSH Server is used on Windows. To install OpenSSH on Windows, go to Settings -> System -> Optional Features -> View Features -> See available features -> OpenSSH Server -> Add.

Taking a FortiClient EMS configuration backup:
- The service sshd is added after installing OpenSSH Server make sure it is running. Refer to the screenshots below. The root directory will be C:\users\<username>.

- In this example, the user sfadmin is logged in while the OpenSSH is running. This means the root directory will be C:\users\sfadmin\.
- Another folder inside this directory can be created. For example, C:\users\sfadmin\ems_backup\ in this example.

- Run the FortiClient EMS CLI Command to create a backup. See execute backup .
Example command:
execute backup --backup.password Qwerty77 --copy.service scp --remote.file /Users/sfadmin/ems_backup/emsdb_22122025.enc --remote.ip 10.30.30.102 --remote.user sfadmin --remote.password @@@@@@@ --yes
Expected output when the backup creation is successful:

The backup is now available under C:\users\sfadmin\ems_backup\.

Restoring a FortiClient EMS configuration backup:
- Make sure the sshd service is running. The root directory will be C:\users\<username>\

- In this example, the user sfadmin is logged in while the OpenSSH is running. As a result, the directory will be C:\users\sfadmin\.
- Another folder inside this directory is created: C:\users\sfadmin\ems_backup\. It contains the backup which needs to be restored. C:\users\sfadmin\ems_backup\emsdb_22122025.enc.

- To restore the backup, see execute restore.
Example command:
execute restore --backup.password Qwerty77 --copy.service scp --remote.file /Users/sfadmin/ems_backup/emsdb_22122025.enc --remote.ip 10.30.30.102 --remote.user sfadmin --remote.password @@@@@@@
Expected output when the restore is successful:

