Just encountered this problem so i want to thank OP, because an image embedded in the config file was the problem in my case as well.
Did a marathon of updating an opnsense firewall from 24.7 -> 26.1.
Upgrade went fine from 24.7 -> 25.1 but shit hit the fan with the upgrade to 25.1.12.
Same as OP, config was reset to a default one, no interfaces, default root pw, etc.. Trying to upload the config via webgui returned 'invalid config'. Trying the run_migrations.php script just takes like 5 minutes and the result is that the config gets nuked again without any output telling me what happened.
Took me a while to find this post but i checked my config and saw that there was indeed an image embedded.
Specifically it was the dashboard picture widget which contained an image.
I removed the two related lines:
<picturewidget> [...] </picturewidget>
<picturewidget_filename>86690901_p0.png</picturewidget_filename>
The filesize shrunk from 12MB to ~140KB.
Tried uploading the config again and it immediately worked and i was able to upgrade up to the newest 26.1.6 without any significant problems.
Did waste a few hours on this tho because nothing actually tells you whats wrong with the config sadly.
Did a marathon of updating an opnsense firewall from 24.7 -> 26.1.
Upgrade went fine from 24.7 -> 25.1 but shit hit the fan with the upgrade to 25.1.12.
Same as OP, config was reset to a default one, no interfaces, default root pw, etc.. Trying to upload the config via webgui returned 'invalid config'. Trying the run_migrations.php script just takes like 5 minutes and the result is that the config gets nuked again without any output telling me what happened.
Took me a while to find this post but i checked my config and saw that there was indeed an image embedded.
Specifically it was the dashboard picture widget which contained an image.
I removed the two related lines:
<picturewidget> [...] </picturewidget>
<picturewidget_filename>86690901_p0.png</picturewidget_filename>
The filesize shrunk from 12MB to ~140KB.
Tried uploading the config again and it immediately worked and i was able to upgrade up to the newest 26.1.6 without any significant problems.
Did waste a few hours on this tho because nothing actually tells you whats wrong with the config sadly.
"