Possible to use Leapp for Oracle 7 -> Oracle 8 migration?

Do it now and we’ll find out :slight_smile:

There is a high chance you’ll see errors like this:

reindexdb: error: reindexing of database "foreman" failed: ERROR:  could not create unique index "index_fact_names_on_name_and_type"
DETAIL:  Key (name, type)=(<something>, PuppetFactName) is duplicated.   

or

reindexdb: error: reindexing of database "foreman" failed: ERROR:  could not create unique index "index_fact_names_on_name_and_type"
DETAIL:  Key (name, type)=(<something>, Katello::RhsmFactName) is duplicated.

Luckily the facts table can be wiped and will be re-populated by clients once the check in again.

For the first error:

# cat << EOF | foreman-rake console
conf.echo = false
fact_name_ids = FactName.unscoped.where(:type => 'PuppetFactName').ids
pp fact_name_ids.count
FactValue.unscoped.where(:fact_name_id => fact_name_ids).delete_all
FactName.unscoped.where(:id => fact_name_ids).delete_all
pp FactName.unscoped.where(:type => 'PuppetFactName').ids.count
EOF 

For the second:

# cat << EOF | foreman-rake console
conf.echo = false
fact_name_ids = FactName.unscoped.where(:type => 'Katello::RhsmFactName').ids
pp fact_name_ids.count
FactValue.unscoped.where(:fact_name_id => fact_name_ids).delete_all
FactName.unscoped.where(:id => fact_name_ids).delete_all
pp FactName.unscoped.where(:type => 'Katello::RhsmFactName').ids.count
EOF   

Then run the reindex command again.

1 Like