Technical Tip: Replacing VPN manager devices via CLI script (ADOM Database)
| Description | This article describes a method to replace Hub devices in complex VPN Manager configurations without deleting and recreating the VPN community. In standard deployments, replacing a Hub requires removing the node and recreating it, which disrupts VPN community structure and Spoke associations. This procedure updates existing VPN Manager Node IDs by modifying the _scope parameter through CLI scripts, allowing the VPN community structure to remain intact while redirecting configuration to new FortiGate devices. |
| Scope | FortiManager v7.4.x, v7.6.x. |
| Solution | Prerequisites Before executing the script, ensure the following requirements are met:
Before modifying the database, VPN Manager Node IDs assigned to existing Hub devices must be identified to ensure correct targeting. Use the following command:
FMG # execute fmpolicy print-adom-object 3 1005 all
After identifying the Node IDs, create a script to be executed on the ADOM Database. The script updates the device association while preserving VPN Phase1/Phase2 configuration mapped to the same Node ID.
Script content:
Important: When replacing the underlying device reference for a Hub, Spoke devices associated with Node IDs (for example, 1 and 6) automatically reference the updated gateway defined in _scope. If the public IP address has changed, ensure that local-gw or external-resource parameters are updated accordingly within the script to reflect the new Hub WAN IP. |
