Migrating to new server

I currently have a puppetmaster (2.6.7) (no storeconfigs) and a
Foreman installation (using SQLLite). I have a new puppetmaster built
using storeconfigs/mysql and would like to migrate all of my clients/
external node data to this new machine. I'm not quite sure what to do
regarding Foreman. I'd like to use MySQL on the new box along with
storeconfigs, but I can't afford to lose all of my external node
classifications.

Any ideas on how to cleanly migrate from the old puppetmaster to the
new one?

Thanks!

> I currently have a puppetmaster (2.6.7) (no storeconfigs) and a
> Foreman installation (using SQLLite). I have a new puppetmaster built
> using storeconfigs/mysql and would like to migrate all of my clients/
> external node data to this new machine. I'm not quite sure what to do
> regarding Foreman. I'd like to use MySQL on the new box along with
> storeconfigs, but I can't afford to lose all of my external node
> classifications.
>
> Any ideas on how to cleanly migrate from the old puppetmaster to the
> new one?
>

Do you care about old facts / reports ?

if you just care about class assignments, then you could use the external
nodes importer [1]

Alternatively, we have a rake task which copies the production db into the
development one (for testing purposes), and you could try to use that to
copy your production sqlite to mysql.

note that it might have a side effect with parameters, (due to STI db
design), but it worth a shot.
in order to use that, point your development db setup to your new production
db and execute:
rake db:convert:prod2dev

in any case, make sure you backup your data :slight_smile:
Ohad

[1] -
http://theforeman.org/projects/foreman/wiki/External_Nodes#Import-your-external-node-setup-from-an-older-external-node-setup

··· On Tue, Apr 19, 2011 at 8:17 PM, Josh wrote:

Thanks!


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

> Do you care about old facts / reports ?
> if you just care about class assignments, then you could use the external
> nodes importer [1]
> Alternatively, we have a rake task which copies the production db into the
> development one (for testing purposes), and you could try to use that to
> copy your production sqlite to mysql.
> note that it might have a side effect with parameters, (due to STI db
> design), but it worth a shot.
> in order to use that, point your development db setup to your new production
> db and execute:
> rake db:convert:prod2dev
> in any case, make sure you backup your data :slight_smile:

Nope, I don't care about saving facts and reports, only node
classifications and their module/group assignments. So, it sounds
like I first need to import all of my hosts using some type of rake
job? And, then import my external node data using the one that you
referenced in the last email?

Josh

> > Do you care about old facts / reports ?
> > if you just care about class assignments, then you could use the external
> > nodes importer [1]
> > Alternatively, we have a rake task which copies the production db into
> the
> > development one (for testing purposes), and you could try to use that to
> > copy your production sqlite to mysql.
> > note that it might have a side effect with parameters, (due to STI db
> > design), but it worth a shot.
> > in order to use that, point your development db setup to your new
> production
> > db and execute:
> > rake db:convert:prod2dev
> > in any case, make sure you backup your data :slight_smile:
>
> Nope, I don't care about saving facts and reports, only node
> classifications and their module/group assignments. So, it sounds
> like I first need to import all of my hosts using some type of rake
> job? And, then import my external node data using the one that you
> referenced in the last email?

Yes, it queries per host based on the host entires in the new database.

You might want to apply for a new feature request :slight_smile:

Ohad

··· On Tue, Apr 19, 2011 at 9:57 PM, Josh Baird wrote:

Josh


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

> Yes, it queries per host based on the host entires in the new database.
>
> You might want to apply for a new feature request :slight_smile:

Ohad,

Ok, so configured my mysql storeconfigs database on the new box as a
development database on the current Foreman instance and ran
prod2dev. My mysql database started being populated with facts, etc.
The rake job then hit this error:

$ rake db:convert:prod2dev
(in /usr/share/foreman)
Converting resources…0 records converted
Converting source_files…0 records converted
Converting resource_tags…0 records converted
Converting puppet_tags…0 records converted
Converting fact_names…162 records converted
Converting fact_values…2798 records converted
Converting param_values…0 records converted
Converting param_names…0 records converted
Converting audits…rake aborted!
Mysql::Error: Table 'puppet.audits' doesn't exist: DELETE FROM
audits

(See full trace by running task with --trace)

Is it looking for an "audits" table on the mysql side or the sqllite
side?

Thanks,

Josh

> > Yes, it queries per host based on the host entires in the new database.
> >
> > You might want to apply for a new feature request :slight_smile:
>
> Ohad,
>
> Ok, so configured my mysql storeconfigs database on the new box as a
> development database on the current Foreman instance and ran
> prod2dev. My mysql database started being populated with facts, etc.
> The rake job then hit this error:
>
> $ rake db:convert:prod2dev
> (in /usr/share/foreman)
> Converting resources…0 records converted
> Converting source_files…0 records converted
> Converting resource_tags…0 records converted
> Converting puppet_tags…0 records converted
> Converting fact_names…162 records converted
> Converting fact_values…2798 records converted
> Converting param_values…0 records converted
> Converting param_names…0 records converted
> Converting audits…rake aborted!
> Mysql::Error: Table 'puppet.audits' doesn't exist: DELETE FROM

audits
>
>
(See full trace by running task with --trace)
>
> Is it looking for an "audits" table on the mysql side or the sqllite
> side?
>

according to the error… it seems that error is returned from the mysql
server…

i would assume you would need the same schema on a clean db…

Ohad

··· On Wed, Apr 20, 2011 at 4:08 PM, Josh wrote: