pgbackups on Heroku not found - postgresql

I have been using pgbackups to capture databases and load them locally but since yesterday, I am getting this message when provisioning the add on for new apps.
! Add-on plan not found.
Has pgbackups been disabled for new instances? It still works on apps it was previously integrated with. If it has been deprecated, what is the recommended replacement?

Heroku have recently made changes. "PG Backups as an add-on has been deprecated." For new commands, see here:
https://devcenter.heroku.com/articles/mapping-pgbackups-commands
Old command:
heroku pgbackups:capture --app sushi
New Command
heroku pg:backups capture --app sushi

So I missed this little disclaimer here: https://devcenter.heroku.com/articles/pgbackups
PG Backups as an add-on has been deprecated. The commands exist as part of the Heroku Postgres namespace in the CLI. The new functionality is live and available for use. We also have a mapping guide to show you how the old commands transfer to the new ones.

To add to response from jcuenod above the same would apply for heroku pg:backups:restore. The new command will be heroku pg:backups restore. Heroku documentation is inconsistent and should be updated.

Related

What is the command to upgrade Heroku Postgresql to a Basic plan

I need to upgrade my Heroku Postgresql database to the Basic plan. I've found the command in Heroku's docs, but I'm not sure if I need to change it to affect my account. My app's name on Heroku is tranquil-mountain-51138
heroku addons:upgrade HEROKU_POSTGRESQL_LAVENDER_URL heroku-postgresql:premium-0 -a sushi
Do I need to change this terminal command to include my app's name and the Basic db plan? If so, could you give me the edited version. My guess would be that I change premium-0 to basic. I've no idea what the rest of the command refers to: HEROKU_POSTGRESQL_LAVENDER_URL and sushi
It is a very small personal app. I'm the only one using it, so I've no worries about down time when the maintenance starts.
Thanks for any help.
Finally received a response from Herouku HelpDesk that explains the parts of their example command for upgrading a db.
Their example: heroku addons:upgrade HEROKU_POSTGRESQL_LAVENDER_URL heroku-postgresql:premium-0 -a sushi
$heroku addons:upgrade DATABASE_URL <database-type> -a <app-name>
For my app, upgrading to their Basic plan, the command is:
$heroku addons:upgrade DATABASE_URL heroku-postgresql:basic -a tranquil-mountain-51138
Hope this helps others.

How to check if there is a PostgreSQL backup scheduled?

I have recently started working on an existing Heroku environment.
How can I tell if there are database backups scheduled?
Assuming you are using Heroku Postgres, you can view backup schedules with the following command:
heroku pg:backups:schedules
You might have to provide the --app argument so Heroku knows which app you're interested in.

How to deploy a FastAPI app using PostgreSQL as a database on Heroku

I developed a FastAPI app in a Virtual Environment using an SQLite database but deployed it on Heroku with a PostgresSQL database on Heroku as suggested in the tutorial. Although it worked on my PC, adding PostegresSQL as an addon & replacing the value of SQLALCHEMY_DATABASE_URL in the database.py broke everything. Note that I've properly frozen the dependencies on the requirements.txt file. Yet I can't figure out what went wrong.
For further clarification, I've pushed my code to GitHub & it can be accessed at this repository - Self_calculation.
If you are using Postgres Addon on Heroku, probably your solution is simple.
Use os.environ to get the connection parameters , don't try to connect directly, it's Heroku's recommended solution from Heroku Postgres
import os
DATABASE_URL = os.environ.get('DATABASE_URL')
I just need to run this:
1)heroku git:remote -a my_heroku_app_name
2)heroku logs --tail
after that I could see my problem.
In my case I forgot to change postgres url in alembic.ini file

Is there a way to copy a postgres db to heroku?

I have a django project that I was initially running on pythonanywhere using a postgres database. However, pythonanywhere doesn't support ASGI, so I am migrating the project over to heroku. Since heroku either much prefers or mandates use of its own postgres functionality, I need to migrate the data from elephantsql. However, I'm really coming up short on how... I tried running pg_dumpall but it didn't seem to want to work and/or the file disappeared into the ether. I'm at a loss for how to make this migration... If anyone could help, I'd appreciate it so much. T-T
After hours of searching and doing what I can to scour heroku's listed info, I found it by running heroku pg:push --help.
For a locally running server, run
heroku pg:push '<db_name>' <heroku_db_name> --app <app_name>
For a hosted one, run
heroku pg:push <postgres_link> <heroku_db_name> --app <app_name>

Automticaly setup add-on Heroku-Postgresql with one command

I want use PostgreSQL 9 in my app and to host on Heroku. By default heroku use Postgres 8.3.
To use Postgres 9, I need to install add-on heroku-postgres(https://addons.heroku.com/heroku-postgresql). In the documentation I found several steps to use Postgresql 9. It is simple, but I need to automatize and simplify all deploy steps.
Questions, I need at least one answer from these questions:
Is it possible by default use Postgresql 9 in Heroku without any add-on?
Is it possible to setup custom database urls names when I add the add-on like heroku addons:add heroku-postgresql:dev CUSTOME_HEROKU_DATABASE_URL_NAME?
Is it possible to use last database url in promote, e.g. heroku pg:promote HEROKU_POSTGRESQL_LAST?
Is it possible to promote database on adding add-on e.g.:heroku addons:add heroku-postgresql:dev --promote?
I don't want to use tools like grep or sed. This solution I built already.
PostgreSQL 9 is the default on Heroku now.
When you create a new Heroku database, it will always auto-generate a name for you (a color), you cannot change this.
There is no way to promote a new database to default without using grep / sed / customizations.
Is it possible by default use Postgresql 9 in Heroku without any add-on?
The dev plan will be the default on heroku. If you want it to be the default for you now, you can by adding this feature flag:
heroku labs:enable default-heroku-postgresql-dev
Is it possible to setup custom database urls names when I add the add-on like heroku addons:add heroku-postgresql:dev CUSTOME_HEROKU_DATABASE_URL_NAME?
No, not yet.
Is it possible to use last database url in promote, e.g. heroku pg:promote HEROKU_POSTGRESQL_LAST?
No, but if you have that flag set up, when you push code for the first time it will provision a dev database for you and it will have been promoted.
Is it possible to promote database on adding add-on e.g.:heroku addons:add heroku-postgresql:dev --promote?
No, but interesting idea.