0

So, I'm using the mysql2psql gem and I've got the following code:

mysql:
 hostname: localhost
 port: 3306
 socket: /tmp/mysql.sock
 username: root
 password: root
 database: hello_development

destination:
 # if file is given, output goes to file, else postgres
 file: 
 postgres:
  hostname: localhost
  port: 5432
  username: root
  password: root
  database: hello_development

# if tables is given, only the listed tables will be converted.  leave empty to convert all tables.
#tables:
#- table1
#- table2
# if exclude_tables is given, exclude the listed tables from the conversion.
#exclude_tables:
#- table3
#- table4


# if supress_data is true, only the schema definition will be exported/migrated, and not the data
supress_data: false

# if supress_ddl is true, only the data will be exported/imported, and not the schema
supress_ddl: false

# if force_truncate is true, forces a table truncate before table loading
force_truncate: false

I'm a bit confused though, as to how I would convert all of my table e.g. test, and production as well. At the moment, it looks like I am just converting hello_development.

Please advice!

1 Answer 1

1

You're specifying which database to use - database: hello_development - which is why it's only running in your development environment. You need to create config files for mysql2pgsql for your test and production environments as well.

Having used mysql2pgsql in the past, keep in mind that there can be a LOT of differences between how mysql and postgres work - make sure that you have fully tested your application in a development environment prior to running this script in your production environment.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.