I’ve been messing around with this all weekend and a friend beat me to the punch with this elegant solution that he submitted to the Docs here:
pg_dump --no-owner --data-only -d $HEROKU_DATABASE_URL | psql -d $DATABASE_URL
By replacing the -C
(which is short for --create
) with --data-only
, we sidestep the schema conflict errors (etc) because we’re saving only the data in the dump file. If you were following the Migrate from Heroku · Fly Docs like I was, you already created the database. So in this step, we just need to fill it with data.
This approach completely solved the problem for me.