@cinlung said in How to automatically reinstall old packages when I restore a configuration file into a new pfsense machine:
Is this done automatically
What about : never give the control to some system, as doing it yourself is better/faster/easier/saver/etc (what ever may apply for you).
This is what I would do : peek into the config file, an ordinary user readable xml file, and see what 'pfSense' packages you have.
Now, install pfSense, fire it up, do the minimal command line (console) interface assignment WAN and LAN and stop there.
Connect to the GUI, make the WAN work - if your WAN is using the default DHCP, this step isn't even needed.
Now, visit the package manager. Just click install one by one all the packages needed - referenced in the config. When you see the green 'all is ok' bar, install the next package.
Do not set them up.
Import your config.xml file. It will find all packages loaded and up to date, it will just configure them.
Restart and done.
If something goes wrong, you'll be knowing exactly what went wrong (which package). The same thing would go wrong when you kick start without packages installed upfront, but then you would see what went wrong.
In a worst case situation you strip the package from the config.xml list (in the package list) and re import the config again.