Skip to main content
awasfi_FTNT
Staff
Staff
Oct 22, 2024 2:55 PM UTC

Technical Tip: Export and Import metadata variable on FortiManager using CLI

Description This article describes how to export metadata variables from an old configuration/FortiManager and import them to the new configuration/FortiManager from CLI.
Scope FortiManager.
Solution

Metadata variables can be exported from a previous configuration or FortiManager and imported to a new configuration or FortiManager from the CLI. Create a script and run it on a Policy Package or ADOM Database to create them on the new configuration/FortiManager.

 

Steps:

  1. Use the following command to view the metadata variables configuration:


execute fmpolicy print-adom-object <ADOM_ID> <Category name or Category_ID> +all

 

For example, the ADOM ID is 4997 and the category name is 'fmg variable'. So it can be used as follows:

 

execute fmpolicy print-adom-object 4997 "fmg variable" +all

 

Alternatively, category ID can be used as follows:


execute fmpolicy print-adom-object 4997 3200 +all

 

  1. Copy the results of the command:

 

Copy.jpg

 

  1. Browse to Device Manager -> Scripts and create a new CLI script to run it on a Policy Package or ADOM Database as highlighted below and paste the output from step (2) in the Script Details.

 

Create_Script.jpg

 

 

  1. Run the Script.

 

run.jpg

 

  1. Select any policy package.

 

run_2.jpg

 

  1. Once the script has been completed successfully, confirm the metadata variables created.

 

created.jpg
Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024