Migrating from Ubuntu 12.04 to 14.04, Foreman 1.11.1

Hey everyone,

I'm having trouble having the hosts migrate over to the new Foreman
instance after pointing the new Foreman instance to the same postgresql
database the old Foreman instance was using. Has anyone experienced this
when doing a migration to a new Foreman instance?
I spun up an Ubuntu 14.04 system and installed Foreman from scratch, then
tried pointing it from the database it created locally to an external
database (that the Ubuntu 12.04 Foreman instance was using). I tried doing
a foreman-rake db:dump and foreman-rake db:import to see if that
helped, but didn't look like it. Both Foreman instances are running version
1.11.1.

Thanks in advance
-hector

> Hey everyone,
>
> I'm having trouble having the hosts migrate over to the new Foreman
> instance after pointing the new Foreman instance to the same postgresql
> database the old Foreman instance was using. Has anyone experienced this
> when doing a migration to a new Foreman instance?
> I spun up an Ubuntu 14.04 system and installed Foreman from scratch, then
> tried pointing it from the database it created locally to an external
> database (that the Ubuntu 12.04 Foreman instance was using). I tried doing
> a foreman-rake db:dump and foreman-rake db:import to see if that
> helped, but didn't look like it. Both Foreman instances are running version
> 1.11.1.
>

did you try foreman-rake db:migrate? I dont think you need the dump or
import options if you already copied the db.

Ohad

··· On Wed, May 18, 2016 at 7:48 AM, Hector Elenes wrote:

Thanks in advance
-hector


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, 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 https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

What's the problem exactly after you configure the external DB? Any
errors, or is it using the wrong database?

··· On 18/05/16 05:48, Hector Elenes wrote: > I'm having trouble having the hosts migrate over to the new Foreman > instance after pointing the new Foreman instance to the same postgresql > database the old Foreman instance was using. Has anyone experienced this > when doing a migration to a new Foreman instance? > I spun up an Ubuntu 14.04 system and installed Foreman from scratch, > then tried pointing it from the database it created locally to an > external database (that the Ubuntu 12.04 Foreman instance was using)


Dominic Cleal
dominic@cleal.org

Hi Dominic,

I was able to see Host Groups, smart proxies, and classes populate fine but
I was missing the hosts. I'm not sure what changed but I'm able to see
hosts and their reports now. After bringing up the old Foreman, Puppet on
the new Foreman instance ran successfully and ran a few things (forgot to
mention I'm using the theforeman/foreman puppet module to deploy the new
instance):

May 18 02:54:51 foreman puppet-agent[5913]: Local environment: "production"
doesn't match server specified node environment "foreman", switching agent
to "foreman".
May 18 02:55:11 foreman puppet-agent[5913]:
(/Stage[main]/Foreman::Database::Postgresql/Postgresql::Server::Db[foreman]/Postgresql::Server::Role[foreman]/Postgresql_psql[ALTER
ROLE foreman ENCRYPTED PASSWORD ****]/command) command changed 'notrun' to
'ALTER ROLE "foreman" ENCRYPTED PASSWORD '$NEWPGPASSWD''
May 18 02:55:11 foreman puppet-agent[5913]:
(/Stage[main]/Foreman::Config/File[/etc/foreman/database.yml]/content)
content changed '{md5}30fe8397990fefb1d138fcb5a4e6e9e8' to
'{md5}717554b740881aa9417cad947fe384bc'
May 18 02:55:26 foreman puppet-agent[5913]:
(/Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate])
Triggered 'refresh' from 1 events
May 18 02:55:34 foreman puppet-agent[5913]:
(/Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed])
Triggered 'refresh' from 1 events
May 18 02:56:24 foreman puppet-agent[5913]:
(/Stage[main]/Foreman::Database/Foreman::Rake[apipie:cache:index]/Exec[foreman-rake-apipie:cache:index])
Triggered 'refresh' from 1 events
May 18 02:56:25 foreman puppet-agent[5913]:
(/Stage[main]/Apache::Service/Service[httpd]/ensure) ensure changed
'stopped' to 'running'
May 18 02:56:25 foreman puppet-agent[5913]:
(/Stage[main]/Foreman::Service/Service[foreman]) Triggered 'refresh' from 1
events
May 18 02:56:25 foreman puppet-agent[5913]:
(/Stage[main]/Foreman::Service/Exec[restart_foreman]) Triggered 'refresh'
from 1 events
May 18 02:56:26 foreman puppet-agent[5913]: Finished catalog run in 79.77
seconds

I know the "/etc/foreman/database.yml" change didn't affect anything since
I made the necessary changes manually before Puppet could (it just removed
some commented lines). I had also made sure to restart Apache since it's
running under Passenger. Do you think the rake commands helped?

Thank you for all of the hard work you and everyone else that contributes
to this project. It really is my favorite piece of open-source software and
I'm so glad it has the support it does.

-hector

··· On Wednesday, May 18, 2016 at 12:11:00 AM UTC-7, Dominic Cleal wrote: > > On 18/05/16 05:48, Hector Elenes wrote: > > I'm having trouble having the hosts migrate over to the new Foreman > > instance after pointing the new Foreman instance to the same postgresql > > database the old Foreman instance was using. Has anyone experienced this > > when doing a migration to a new Foreman instance? > > I spun up an Ubuntu 14.04 system and installed Foreman from scratch, > > then tried pointing it from the database it created locally to an > > external database (that the Ubuntu 12.04 Foreman instance was using) > > What's the problem exactly after you configure the external DB? Any > errors, or is it using the wrong database? > > -- > Dominic Cleal > dom...@cleal.org >

Hey Ohad,

Sorry I didn't see your reply. I think the foreman-rake db:migrate might
have helped. If you see the reply to Dominic, Puppet ran those commands and
I started seeing the hosts on the new Foreman instance. I had seen those
foreman-rake commands when upgrading Foreman to a newer version, but I
wasn't sure if that was necessary when doing a migration so I didn't want
to run something outside of the docs. I should look into what those
commands do -_-. Thanks for replying Ohad!

-hector

··· On Tuesday, May 17, 2016 at 10:05:07 PM UTC-7, ohad wrote: > > > > On Wed, May 18, 2016 at 7:48 AM, Hector Elenes > wrote: > >> Hey everyone, >> >> I'm having trouble having the hosts migrate over to the new Foreman >> instance after pointing the new Foreman instance to the same postgresql >> database the old Foreman instance was using. Has anyone experienced this >> when doing a migration to a new Foreman instance? >> I spun up an Ubuntu 14.04 system and installed Foreman from scratch, then >> tried pointing it from the database it created locally to an external >> database (that the Ubuntu 12.04 Foreman instance was using). I tried doing >> a `foreman-rake db:dump` and `foreman-rake db:import` to see if that >> helped, but didn't look like it. Both Foreman instances are running version >> 1.11.1. >> > > did you try foreman-rake db:migrate? I dont think you need the dump or > import options if you already copied the db. > > Ohad > >> >> Thanks in advance >> -hector >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at https://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> > >