If you are in the process of migrating from one Windows server to another and want the same firewall setting, you need to add all the rules manually or you can import/export the rule on windows server 2016 using the below steps.
Step 1: Export Firewall Rules
1. Go to Start >> Administrative Tools >> Windows Firewall and Advanced Security.
2. Right, Click on Windows Firewall and Advanced Security and select Export Policy.
3. Save the Exported policy rule file on your server.
4. Once you save the rule file, it will generate a pop-up saying Policy successfully exported.
Step 2: Import Firewall Rules
1. First of all, you will need to share the firewall rule file to the Destination server where you are looking to export your firewall rules.
2. Go to Windows Firewall and Advanced Security of your Destination server.
3. Right, Click on Windows Firewall and Advanced Security and select Import.
4. Once you import the policy, it will ask that you overwrite all the current rules. Please be sure that you wish to overwrite the current rule. Select the yes button to proceed with the import.
5. Select the file which we have imported from the source server.
6. It will give the below pop-up once the file is imported.
This is it. We are done with firewall import/export.