I used to have a foreman 1.24 and I am upgrading to 2.5 now. However, the upgrade fails.
Expected outcome:
The command
foreman-rake db:migrate
fails with an error
NoMethodError: undefined method operatingsystems' for nil:NilClass /usr/share/foreman/db/migrate/20210115124508_template_kind_registration.rb:26:in block in up’
How exactly? As far as I know you can skip only one minor version when upgrading. Upgrading directly from 1.24 to 2.5 is not supported, if that’s what you are trying. You would have to go through 2.1 and 2.3 at a minimum or even through all minor version, to be sure.
You are not using katello?
3.0 has not been released. If this is a production system, I would recommend against that.
I doubt that. You more likely broke it in a place you haven’t noticed, yet. What you did is very dangerous. Don’t expect the system to fully work correctly. Don’t expect future updates to work correctly.
There is a reason why the migration script does what it does and simply omitting some things has the potential to break things internally resulting in weird problems and strange errors noone would ever expect…
Go to Administer - Settings - Provisioning. Check the current value for the setting “Default ‘Host initial configuration’ template”. I have “Linux host_init_config default” set there.
Now go to Hosts - Provisioning Templates. Search for the “Linux host_init_config default” template and lick on it to see the settings. Click on the Association tab and check which operating systems are associated with the template. It should be all operating systems your foreman know about. I think that’s what this line does…
Considering the code there, I guess you are missing the setting or the setting is not properly initialized. You didn’t answer, but I guess you have jumped too many version during the upgrade and lost a couple of things on the way…