If you working with mysql and loading database with "rake db:structure:load"
Then later you want migrate from mysql to postgres then "rake db:structure:load" command will not work with Postgres,you will need to convert sql to postgres
Blow are the commands which directly insert .sql file into PG databse then you can create .dump file from postgres which can be use on heroku.
Export .sql from mysql
mysqldump -u username -p --compatible=postgresql databasename > data.sql
Import .sql into Postgres
psql -h server -d databasename -U username -f data.sql
Then you can create dump file from PG
pg_dump databasename > outfile.dump
Now you can push this dump file on heroku also.
Thanks
Comments
Post a Comment