The purpose of creating this KB article is because renaming the zone on multiple rules will be time-consuming from webUI. Please go through the solution section to achieve this
(i) Login to the MySQL database
mysql -ujboss -p$(grep mysql.jboss /etc/sysconfig/JunosSpace/pwd | awk -F= '{print $2}') sm_db
(ii) Run the below command with the policy name which is assigned to the devices
mysql> select * from DCPolicyEntity where name="test_policy"\G; *************************** 1. row *************************** id: 1905591 domainId: 3 version: 1 createdAt: 1684947541425 createdByUserName: super definitionType: 2 editVersion: 0 lastModifiedAt: 1684947541425 lastModifiedByUserName: NULL owningSystem: NULL policyState: 1 saveComments: NULL servicePublishState_id: 1905592 description: CIT old Firewall G Harpy fwPolicyType: 0 name: CL-Condor-G-CHANGEIT_Modified outOfBandChanged: 0 policyOrder: -2147482148.000000000000000 policyType: 1 policyProfile_id: NULL 1 row in set (0.00 sec)
(iii) Note down the id of the policy from the above output and run the below command.
mysql> update DCRuleEntity set fromZoneValue="test_zone2" where (fromZoneValue='test_zone1' AND groupPolicy_id='1905591'); Query OK, 814 rows affected (0.05 sec) Rows matched: 814 Changed: 814 Warnings: 0 mysql> update DCRuleEntity set toZoneValue="test_zone2" where (toZoneValue='test_zone1' AND groupPolicy_id='1905591'); Query OK, 953 rows affected (0.05 sec) Rows matched: 953 Changed: 953 Warnings: 0
This will change the source and destination zone from test_zone1 to test_zone2
(iv) Please export the policy to the ZIP file and import it.
(v) After that, there will be a policy with _1 will be created, you can unassign the device from the current policy and assign it to the new policy.
Note: Please take a Backup/VM snapshot/Clone of the policy before making any changes for the rollback plan.