postgresql - Importing MySQL to Postgres. Permission issues -


i have mysql , postgres databases. have been working on mysql db populated data. me use heroku, need port postgres. these steps followed:

i exported data mysql db simple dump command:

mysqldump -u [uname] -p[pass] db_name > db_backup.sql 

i logged postgres

sudo su postgres 

now when try import sql postgres, not have access db_backup.sql. changed permissions users , made dump file read/write still cannot import sql.

my question correct way duplicate (both schema , data) mysql postgres. why not able access dump file after changing permissions? , if have dump mysql chances runs issues while running on postgres (i not have procedural stuff in mysql. creation of tables , dumping data tables.)?

thanks!

p.s. on mac-mavericks if matters

while primary part of question answered @wildplasser thought put entire answer people looking @ porting mysql data postgres.

after trying out multiple solutions, easiest , quite smooth solution this: https://github.com/lanyrd/mysql-postgresql-converter

this worked quite smoothly. 1 problem- not port of mysql sequences postgres. means if have auto-increment primary ids, have change postgres schema separately , create serial sequences after porting done. apart that, quite smooth.

to talk permission issue, logging in postgres user , trying access dump created original user failed, right way stay logged in original user , use postgres user db operation using -u postgresuser command.

e.g.: psql -u postgres databasename < data_base_dump

while many must obvious way of doing it, must admit 1 of eureka moments me :)


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -