PGError: ERROR: relation "inventory_nodes" does not exist

Hello,

I'm trying to convert my Foreman mysql db to PostgreSQL but getting error
during the conversion process. Any suggestions how to fix it?

[root@puppet /usr/share/foreman]# foreman-rake db:convert:prod2dev --trace
** Invoke db:convert:prod2dev (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:convert:prod2dev
Converting architectures…4 records converted in 0.785592445 seconds
Converting architectures_operatingsystems…0 records converted in
0.056985472 seconds
Converting audits…87364 records converted in 551.83943572 seconds
Converting auth_sources…3 records converted in 0.656046039 seconds
Converting bookmarks…8 records converted in 0.177283701 seconds
Converting cached_user_roles…67 records converted in 0.622904467 seconds
Converting cached_usergroup_members…1 records converted in 0.152963192
seconds
Converting compute_attributes…0 records converted in 0.090993242 seconds
Converting compute_profiles…3 records converted in 0.087404709 seconds
Converting compute_resources…0 records converted in 0.04133514 seconds
Converting config_group_classes…14 records converted in 0.101439621
seconds
Converting config_groups…5 records converted in 0.276025426 seconds
Converting config_templates…44 records converted in 0.390689991 seconds
Converting config_templates_operatingsystems…0 records converted in
0.086656403 seconds
Converting domains…20 records converted in 0.391361924 seconds
Converting environment_classes…5123 records converted in 24.253780674
seconds
Converting environments…9 records converted in 0.163522669 seconds
Converting external_usergroups…0 records converted in 0.082249342 seconds
Converting fact_names…1106 records converted in 6.006156544 seconds
Converting fact_values…47211 records converted in 235.634762014 seconds
Converting features…8 records converted in 0.123866515 seconds
Converting features_smart_proxies…2 records converted in 0.119799741
seconds
Converting filterings…221 records converted in 1.513233953 seconds
Converting filters…100 records converted in 0.603650356 seconds
Converting host_classes…81 records converted in 0.568662933 seconds
Converting host_config_groups…0 records converted in 0.060397095 seconds
Converting hostgroup_classes…50 records converted in 0.372708315 seconds
Converting hostgroups…326 records converted in 2.349277694 seconds
Converting hosts…431 records converted in 4.670964794 seconds
rake aborted!
PGError: ERROR: relation "inventory_nodes" does not exist
: ALTER TABLE inventory_nodes DISABLE TRIGGER ALL;
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:654:in
async_exec' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:654:inblock in execute'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:280:in
block in log' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:ininstrument'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:275:in
log' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:653:inexecute'
/usr/share/foreman/lib/tasks/convert.rake:100:in block (4 levels) in <top (required)>' /usr/share/foreman/lib/tasks/convert.rake:84:ineach'
/usr/share/foreman/lib/tasks/convert.rake:84:in block (3 levels) in <top (required)>' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:incall'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in block in execute' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:ineach'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in execute' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:158:inblock in
invoke_with_call_chain'
/opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in mon_synchronize' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:ininvoke_with_call_chain'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:144:in invoke' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:116:ininvoke_task'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in block (2 levels) in top_level' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:ineach'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in block in top_level' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:instandard_exception_handling'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:88:in top_level' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:66:inblock in run'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in
standard_exception_handling' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:inrun'
/opt/rh/ruby193/root/usr/bin/rake:32:in `<main>'
Tasks: TOP => db:convert:prod2dev

Thank you in advance,
Nikolay

This is bug Bug #3236: prod2dev assumes all production tables exist in development - Foreman, where unused
tables in the source database cause problems as they're not created in
the destination.

I'd suggest dropping the table in MySQL. It isn't used by Foreman, but
as always, please take a backup
(Foreman :: Manual).

··· On 14/09/15 21:31, Nikolay Georgieff wrote: > Hello, > > I'm trying to convert my Foreman mysql db to PostgreSQL but getting > error during the conversion process. Any suggestions how to fix it? > > [root@puppet /usr/share/foreman]# foreman-rake db:convert:prod2dev --trace > ** Invoke db:convert:prod2dev (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute db:convert:prod2dev > Converting architectures...4 records converted in 0.785592445 seconds > Converting architectures_operatingsystems...0 records converted in > 0.056985472 seconds > Converting audits...87364 records converted in 551.83943572 seconds > Converting auth_sources...3 records converted in 0.656046039 seconds > Converting bookmarks...8 records converted in 0.177283701 seconds > Converting cached_user_roles...67 records converted in 0.622904467 seconds > Converting cached_usergroup_members...1 records converted in 0.152963192 > seconds > Converting compute_attributes...0 records converted in 0.090993242 seconds > Converting compute_profiles...3 records converted in 0.087404709 seconds > Converting compute_resources...0 records converted in 0.04133514 seconds > Converting config_group_classes...14 records converted in 0.101439621 > seconds > Converting config_groups...5 records converted in 0.276025426 seconds > Converting config_templates...44 records converted in 0.390689991 seconds > Converting config_templates_operatingsystems...0 records converted in > 0.086656403 seconds > Converting domains...20 records converted in 0.391361924 seconds > Converting environment_classes...5123 records converted in 24.253780674 > seconds > Converting environments...9 records converted in 0.163522669 seconds > Converting external_usergroups...0 records converted in 0.082249342 seconds > Converting fact_names...1106 records converted in 6.006156544 seconds > Converting fact_values...47211 records converted in 235.634762014 seconds > Converting features...8 records converted in 0.123866515 seconds > Converting features_smart_proxies...2 records converted in 0.119799741 > seconds > Converting filterings...221 records converted in 1.513233953 seconds > Converting filters...100 records converted in 0.603650356 seconds > Converting host_classes...81 records converted in 0.568662933 seconds > Converting host_config_groups...0 records converted in 0.060397095 seconds > Converting hostgroup_classes...50 records converted in 0.372708315 seconds > Converting hostgroups...326 records converted in 2.349277694 seconds > Converting hosts...431 records converted in 4.670964794 seconds > rake aborted! > *PGError: ERROR: relation "inventory_nodes" does not exist*


Dominic Cleal
dominic@cleal.org

Thank you for your advice. I’ve dropped few tables and I was able to convert the database to Postgresql.

Thank you,
Nikolay

··· > On Sep 15, 2015, at 12:30 AM, Dominic Cleal wrote: > > On 14/09/15 21:31, Nikolay Georgieff wrote: >> Hello, >> >> I'm trying to convert my Foreman mysql db to PostgreSQL but getting >> error during the conversion process. Any suggestions how to fix it? >> >> [root@puppet /usr/share/foreman]# foreman-rake db:convert:prod2dev --trace >> ** Invoke db:convert:prod2dev (first_time) >> ** Invoke environment (first_time) >> ** Execute environment >> ** Execute db:convert:prod2dev >> Converting architectures...4 records converted in 0.785592445 seconds >> Converting architectures_operatingsystems...0 records converted in >> 0.056985472 seconds >> Converting audits...87364 records converted in 551.83943572 seconds >> Converting auth_sources...3 records converted in 0.656046039 seconds >> Converting bookmarks...8 records converted in 0.177283701 seconds >> Converting cached_user_roles...67 records converted in 0.622904467 seconds >> Converting cached_usergroup_members...1 records converted in 0.152963192 >> seconds >> Converting compute_attributes...0 records converted in 0.090993242 seconds >> Converting compute_profiles...3 records converted in 0.087404709 seconds >> Converting compute_resources...0 records converted in 0.04133514 seconds >> Converting config_group_classes...14 records converted in 0.101439621 >> seconds >> Converting config_groups...5 records converted in 0.276025426 seconds >> Converting config_templates...44 records converted in 0.390689991 seconds >> Converting config_templates_operatingsystems...0 records converted in >> 0.086656403 seconds >> Converting domains...20 records converted in 0.391361924 seconds >> Converting environment_classes...5123 records converted in 24.253780674 >> seconds >> Converting environments...9 records converted in 0.163522669 seconds >> Converting external_usergroups...0 records converted in 0.082249342 seconds >> Converting fact_names...1106 records converted in 6.006156544 seconds >> Converting fact_values...47211 records converted in 235.634762014 seconds >> Converting features...8 records converted in 0.123866515 seconds >> Converting features_smart_proxies...2 records converted in 0.119799741 >> seconds >> Converting filterings...221 records converted in 1.513233953 seconds >> Converting filters...100 records converted in 0.603650356 seconds >> Converting host_classes...81 records converted in 0.568662933 seconds >> Converting host_config_groups...0 records converted in 0.060397095 seconds >> Converting hostgroup_classes...50 records converted in 0.372708315 seconds >> Converting hostgroups...326 records converted in 2.349277694 seconds >> Converting hosts...431 records converted in 4.670964794 seconds >> rake aborted! >> *PGError: ERROR: relation "inventory_nodes" does not exist* > > This is bug http://projects.theforeman.org/issues/3236, where unused > tables in the source database cause problems as they're not created in > the destination. > > I'd suggest dropping the table in MySQL. It isn't used by Foreman, but > as always, please take a backup > (http://theforeman.org/manuals/1.9/index.html#5.5.1Backup). > > -- > Dominic Cleal > dominic@cleal.org > > -- > You received this message because you are subscribed to a topic in the Google Groups "Foreman users" group. > To unsubscribe from this topic, visit https://groups.google.com/d/topic/foreman-users/4Rk6Ew8k118/unsubscribe. > To unsubscribe from this group and all its topics, send an email to foreman-users+unsubscribe@googlegroups.com. > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at http://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.