I have been following the documentation Heroku docs on the subject and have gone through this and tried variations on what it says to do to for
Direct database-to-database copies
I am convinced the docs are wrong or I have some setting or somthing wrong (do have admin access). I have also read some scattered things on SO that the command in the heroku CLI for how to do this has changed.
When I run this command (using the credentials for my heroku DB)
heroku pg:copy sushi::ORANGE GREEN --app sushi-staging
After I confirm the message:
WARNING: Destructive action ▸ This command will remove all data from
and confirm. Then I get an error that says:
Heroku PostgreSQL database must be source or target
What is the corrrect way to copy data from a postgresql database in one app to a postgresql database in another app on heroku?
PostgreSQL copy database within the same server: PostgreSQL makes it simple to do so using the CREATE DATABASE statement as follows: Syntax: CREATE DATABASE target_database WITH TEMPLATE source_database; This statement copies the source_database to the target_database.
This worked for me:
heroku pg:copy [origin databasee URI] DATABASE_URL --app [app-name]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With