I was one of the users who had their free DB deleted. I notice they left me with a DB copy when I run heroku pg:backups as you can see below:
(venv) MacBook-Pro-4:TheDropCore adamlamorre$ heroku pg:backups
› Warning: heroku update available from 7.60.2 to 8.0.1.
=== Backups
No backups. Capture one with heroku pg:backups:capture
=== Restores
No restores found. Use heroku pg:backups:restore to restore a backup
=== Copies
ID Started at Status Size From To
──── ───────────────────────── ─────────────────────────────────── ──────── ───────── ───────────
c001 2021-11-22 02:49:15 +0000 Completed 2021-11-22 02:49:33 +0000 120.00KB From Name Target Name
How do I access c001 and apply it to a new DB?
Related
I am tried to take a backup from my odoo 12 server and this was done correctly, immediately I am trying to restore it again, and I found this error
Database restore error: Postgres subprocess ('/usr/bin/pg_restore', '--dbname=database_name', '--no-owner', '/tmp/tmp2bohi3ne') error 1
odoo installed and running with docker-compose
so how can I restore it again
I'm trying to push a local PostgreSQL database to one I've created on a Heroku app. To set up the Heroku database, I ran heroku addons:create heroku-postgresql:hobby-dev -a jasons-react-jobly-app, where jasons-react-jobly-app is the name of my Heroku app.
Then I ran heroku pg:push jobly DATABASE_URL -a jasons-react-jobly-app, where jobly is the name of my local database.
This throws the below error:
heroku-cli: Pushing jobly ---> postgresql-animate-30221
case
------------------------------------
0.9992547478473790.999254747847379
(1 row)
! Cannot read property 'includes' of undefined
The error looks like an error that JavaScript throws when it tries to read properties of an undefined object or something, but I'm not sure where that would be happening in this database push. The app runs completely fine on my local machine with no errors. There is no case column in any of my database tables, so I'm not sure where that number is coming from either.
Also, if I check my Heroku config variables with heroku config, I see:
DATABASE_URL: postgres://iqawqkjfiybndd:c3e921131c239ccd6c880ad4b601deeaa4558339a90ebedc562a5575c9099f42#ec2-54-156-85-145.compute-1.amazonaws.com:5432/dul2u6r13aq5i
So I know the database exists.
Any help with solving this error?
You need to fetch the name of the DB that you see attached to the heroku app on heroku dashboard.
At this url https://dashboard.heroku.com/apps/{put-your-app-name-here}/resources
To get all app names in heroku cli do heroku apps and you will know which app's DB name you want from its dashboard.
Once you have the name of the DB (it will look like this "postgresql-pointy-81624")
use that name in the command to push local db to that db on heroku .
Here are steps to make sure everything works correctly
1- Check the connectivity to the heroku db first by doing
heroku pg:psql postgresql-[somedb name as found above] --app {your-app-name}
2- If it says to reset the DB and you can afford to reset then reset it using
heroku pg:reset -a {your-app-name}
3- Lastly do the migration of DB using this command
heroku pg:push jobly postgresql-[db name found above] -a {your-app-name}
if everything works as expected you will see this message
heroku-cli: Pushing complete.
$ heroku pg:pull DATABASE_URL mylocaldb2 --app afternoon-sunday-4103
heroku-cli: Pulling postgresql-globular-1902 ---> mylocaldb2
it then stalls out at
pg_dump: dumping contents of table photos
I ran it three times now, including over night. This is not a large database.
$ heroku pg:info
Tables: 32
Rows: 1775
Data Size: 9.9 MB
$ heroku pg:psql
psql (9.4.10, server 9.4.9)
How do I troubleshoot? I am trying to pull my production database to my local database. My local databases are all empty.
I could not get this to work and just used capture/download instead.
https://devcenter.heroku.com/articles/heroku-postgres-import-export
This question was asked on 3/15/2015.
I read https://devcenter.heroku.com/articles/heroku-postgres-backups and learnt how to capture backups or schedule daily backup.
I used "heroku pg:backups schedule --at='02:00 EDT' DATABASE_URL --app MYAPPNAME" to set a daily backup of my app. However, two days later I could not find any daily backups.
To be more specific, when I used "heroku pg:backups" (devcenter.heroku.com/articles/heroku-postgres-backups#checking-backup-status), I saw "=== Backups ..." (backups I manually made would list there), but I did not see "=== Schedule DATABASE_URL: daily".
Heroku Toolbelt had the newest version.
I had heroku-postgresql as an add-on.
I did not have "PG Backups as an add-on", since it was deprecated (devcenter.heroku.com/changelog-items/623).
I am wondering if that is because my app is a personal app and it does not have the support of daily support, but I cannot find related information. This was answered by jcuenod.
Now my question is I cannot see daily backups when I run "heroku pg:backups".
Thanks
"heroku addons" gave me:
=== myapp Configured Add-ons
heroku-postgresql:hobby-dev HEROKU_POSTGRESQL_AQUA
"heroku pg:backups schedules" gave me:
=== Backup Schedules
HEROKU_POSTGRESQL_AQUA_URL: daily at 2:00 (America/New_York)
"heroku pg:backups" gave me:
=== Backups
ID Backup Time Status Size Database
---- ------------------------- ---------------------------------- ------ --------
b003 2015-03-15 17:53:51 +0000 Finished 2015-03-15 17:54:11 +0000 75.9kB AQUA
b002 2015-03-14 16:44:02 +0000 Finished 2015-03-14 16:44:15 +0000 75.8kB AQUA
b001 2015-03-13 20:26:33 +0000 Finished 2015-03-13 20:26:39 +0000 75.2kB AQUA
=== Restores
b001, b002 and b003 are all backups I manually made.
Heroku updated their tutorial (h_t_t_ps://devcenter.heroku.com/articles/heroku-postgres-backups) on 3/18/2015.
Heroku updated their tutorial (h_t_t_ps://devcenter.heroku.com/articles/heroku-postgres-backups) on 3/19/2015, again.
On https://devcenter.heroku.com/articles/heroku-postgres-plans I see
All tiers share the following features:
...
Daily logical database backups with PG Backups (optional but free)
The syntax you are using looks right.
Also, when I run heroku addons, I get
=== myapp Configured Add-ons
heroku-postgresql:hobby-dev HEROKU_POSTGRESQL_GOLD
pgbackups:plus
What is the output of heroku pg:backups schedules?
I created a new Heroku app, and then attached the Dev Heroku Postgres db to it.
In the app's activity log, I see:
v07 : Attach HEROKU_POSTGRESQL_GOLD resource 5 minutes ago
v06 : Deploy 076b03a 19 minutes ago
v05 : Add config 19 minutes ago
v04 : Add DATABASE_URL config 19 minutes ago
v03 : Attach HEROKU_POSTGRESQL_AMBER resource 19 minutes ago
v02 : Enable Logplex 21 minutes ago
v01 : Initial release 21 minutes ago
So the GOLD db must be the Dev version I added. What is AMBER?
When you deployed your app initially, we automatically provision one database for you (a dev) if you need it (we detect for example the pg gem in your Gemfile, if this is a ruby app. This would be HEROKU_POSTGREQL_AMBER, which we also happened to set as your DATABASE_URL
Consequently, you manually provisioned another database, HEROKU_POSTGRESQL_GOLD, presumably via heroku addons:add heroku-postgresql.
My guess is you're using HEROKU_POSTGRESQL_AMBER because it must be set to the value of DATABASE_URL. To verify this, try heroku config --app <your-app> | grep postgres. You could also just run heroku pg:info --app <your-app> to check all databases installed on your app, and also verify which is your primary (DATABASE_URL).
You can then remove the spare with heroku addons:remove HEROKU_POSTGRESQL_<COLOR-OF-THE-SPARE-MOST-LIKELY-GOLD>.