Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Foreman instance to new infrastructure #1686

Closed
6 of 14 tasks
ehelms opened this issue Nov 5, 2021 · 5 comments
Closed
6 of 14 tasks

Migrate Foreman instance to new infrastructure #1686

ehelms opened this issue Nov 5, 2021 · 5 comments
Assignees

Comments

@ehelms
Copy link
Member

ehelms commented Nov 5, 2021

The Foreman instance needs to be migrated off of Rackspace and on to newer infrastructure.

Naming:

  • hostname: foreman01.<provider>.theforeman.org
  • servicename: foreman.theforeman.org

Action Items:

  • Create new virtual machine on a provider
  • Manage Foreman with Puppet
    • Write up classes to manage our Foreman instance
    • Put Puppet into noop mode
    • Iterate till things look good
    • Take Puppet out of noop mode
  • Add new machine to existing Foreman and apply puppet
  • PIck switchover date
    • Target date:
    • Lower TTL day or two before target date
  • Dump database on puppetmaster.theforeman.org
  • Copy files
  • Restore database on new machine
  • Update DNS
@ekohl ekohl added this to the Rackspace migration milestone Nov 5, 2021
@ekohl ekohl self-assigned this Sep 15, 2022
@ekohl
Copy link
Member

ekohl commented Sep 15, 2022

I installed foreman01.conova.theforeman.org (IPv6-only for now) with CentOS 8 Stream. Then ran:

dnf install https://yum.puppet.com/puppet7-release-el-8.noarch.rpm https://yum.theforeman.org/releases/3.1/el8/x86_64/foreman-release.rpm
dnf module enable ruby:2.7 postgresql:12
dnf install puppet-agent postgresql-server foreman-postgresql foreman-libvirt foreman-openstack foreman-service foreman-plugin-ansible foreman-plugin-remote_execution foreman-plugin-puppet

. /etc/profile.d/puppet-agent.sh
puppet config set --section agent server puppet.theforeman.org
puppet ssl bootstrap
systemctl enable --now puppet

postgresql-setup --initdb

Note I chose Foreman 3.1 because that's the last version that can import a Foreman < 2.0 DB and migrate it correctly. The list of plugins is what's currently installed and foreman_puppet (which didn't exist in 1.24 but was in core).

I've also chosen NOT to include a Foreman Proxy - this will run on the puppetserver instead.

@ekohl
Copy link
Member

ekohl commented Sep 15, 2022

Doing a restore shows a problem:

$ sudo -u postgres createuser foreman
$ sudo -u postgres createdb -O foreman foreman
$ cat foreman.sql | sudo -u postgres psql -d foreman -f -
$ sudo foreman-rake db:migrate
....
== 20200326164755 ChangeOidcAudienceSettingType: migrating ====================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

The single-table inheritance mechanism failed to locate the subclass: 'Setting::Auth'. This error is raised because the column 'category' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Setting.inheritance_column to use another column for that information.
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:234:in `rescue in find_sti_class'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:227:in `find_sti_class'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:215:in `discriminate_class_for_record'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/persistence.rb:257:in `instantiate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `block (2 levels) in find_by_sql'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `block in each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `map'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `block in find_by_sql'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:56:in `find_by_sql'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:821:in `block in exec_queries'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:839:in `skip_query_cache_if_necessary'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:808:in `exec_queries'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:626:in `load'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:250:in `records'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:499:in `find_take'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:98:in `take'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:81:in `find_by'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:21:in `find_by'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/core.rb:183:in `find_by'
/usr/share/foreman/db/migrate/20200326164755_change_oidc_audience_setting_type.rb:3:in `up'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:831:in `exec_migration'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:812:in `block (2 levels) in migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:811:in `block in migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:471:in `with_connection'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:810:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1002:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1310:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1361:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/transactions.rb:212:in `transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1361:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1309:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1281:in `block in migrate_without_lock'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1280:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1280:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1229:in `block in migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1382:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1229:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1061:in `up'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1036:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/tasks/database_tasks.rb:238:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/railties/databases.rake:86:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/railties/databases.rake:84:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/railties/databases.rake:84:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'

Caused by:
ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Setting::Auth'. This error is raised because the column 'category' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Setting.inheritance_column to use another column for that information.
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:234:in `rescue in find_sti_class'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:227:in `find_sti_class'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:215:in `discriminate_class_for_record'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/persistence.rb:257:in `instantiate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `block (2 levels) in find_by_sql'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `block in each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `map'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `block in find_by_sql'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:56:in `find_by_sql'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:821:in `block in exec_queries'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:839:in `skip_query_cache_if_necessary'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:808:in `exec_queries'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:626:in `load'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:250:in `records'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:499:in `find_take'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:98:in `take'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:81:in `find_by'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:21:in `find_by'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/core.rb:183:in `find_by'
/usr/share/foreman/db/migrate/20200326164755_change_oidc_audience_setting_type.rb:3:in `up'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:831:in `exec_migration'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:812:in `block (2 levels) in migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:811:in `block in migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:471:in `with_connection'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:810:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1002:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1310:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1361:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/transactions.rb:212:in `transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1361:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1309:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1281:in `block in migrate_without_lock'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1280:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1280:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1229:in `block in migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1382:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1229:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1061:in `up'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1036:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/tasks/database_tasks.rb:238:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/railties/databases.rake:86:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/railties/databases.rake:84:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/railties/databases.rake:84:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'

Caused by:
NameError: uninitialized constant Setting::Auth
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:284:in `const_get'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:284:in `block in constantize'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:280:in `each'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:280:in `inject'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:280:in `constantize'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:229:in `find_sti_class'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:215:in `discriminate_class_for_record'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/persistence.rb:257:in `instantiate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `block (2 levels) in find_by_sql'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `block in each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `map'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `block in find_by_sql'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:56:in `find_by_sql'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:821:in `block in exec_queries'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:839:in `skip_query_cache_if_necessary'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:808:in `exec_queries'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:626:in `load'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:250:in `records'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:499:in `find_take'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:98:in `take'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:81:in `find_by'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:21:in `find_by'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/core.rb:183:in `find_by'
/usr/share/foreman/db/migrate/20200326164755_change_oidc_audience_setting_type.rb:3:in `up'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:831:in `exec_migration'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:812:in `block (2 levels) in migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:811:in `block in migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:471:in `with_connection'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:810:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1002:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1310:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1361:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/transactions.rb:212:in `transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1361:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1309:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1281:in `block in migrate_without_lock'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1280:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1280:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1229:in `block in migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1382:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1229:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1061:in `up'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1036:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/tasks/database_tasks.rb:238:in `migrate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/railties/databases.rake:86:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/railties/databases.rake:84:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/railties/databases.rake:84:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

@ekohl
Copy link
Member

ekohl commented Sep 15, 2022

It migrated after changing /usr/share/foreman/db/migrate/20200326164755_change_oidc_audience_setting_type.rb and /usr/share/gems/gems/foreman_remote_execution-5.0.6/db/migrate/20200623073022_rename_sudo_password_to_effective_user_password.rb to return early. I don't think we have that oidc audience setting and didn't use remote_execution_sudo_password either.

Edit: also copied over /usr/share/foreman/config/initializers/encryption_key.rb. Then it also ran seed.

@ekohl
Copy link
Member

ekohl commented Sep 15, 2022

I started the service and quickly went through it. Looks like it correctly restored it. Tomorrow I'll take a look at the Puppet side of it all and prepare the actual migration.

Before that I'll do a fresh dump and restore so we don't lose data.

@ekohl
Copy link
Member

ekohl commented Jan 13, 2023

In #1777 there's the real migration plan. This is now resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants