Copy data between foreman

We are using foreman 1.14 and moving to 3.4
DB migration seems impossible.
I need to copy all of my hosts from the old foreman (mysql) to the new foreman (postgress)
Is there a correct way of doing it? has anyone tried it before ?


Hello, I don’t have a success story about changing database, but I saw some commands for foreman-rake that allows you to make a dump of your database and load dump to the new one. Try to look in this direction (foreman-rake --tasks).
Also you can try simply make a backup of your database with any other common tool and restore it on new database for new Foreman, and switch your old Foreman to new database. After you confirm that everything works fine, you need to update your Foreman version by version, step by step from 1.14 to 3.4 including all intermediate versions and run db migrations (foreman-rake db:migration and foreman-rake db:seed) with every new Foreman version. This may take a while.
As far as I know, there are a lot of important changes in DB structure in every version and they are not cumulative, so you need patch every single version.
Recently we had updated our Foreman environment from 1.24 to 3.2 in that way except for changing database from Mysql to Postgres.
I wonder if there are any better options :slightly_smiling_face:. It will be nice if there is a better and easier way to upgrade.