getting 'backup not found' on heroku pgbackups - heroku

I want to restore the backup from staging to demo
I followed the documentation on heroku and combed through SO but no luck so far.
I am using Windows 7 and versions are:
heroku/toolbelt/2.33.2 (i386-mingw32) ruby/1.9.2
Ruby: ruby 1.9.3p194 (2012-04-20) [i386-mingw32]
Rails: 3.2.7
Steps:
$heroku pgbackups:capture
HEROKU_POSTGRESQL_ONYX_URL (DATABASE_URL) ----backup---> b004
←[0KCapturing... donet |
←[0KStoring... done
$heroku pgbackups:url
"https://s3.amazonaws.com/hkpgbackups........."
I know the command above is not required but I did it anyway just to make sure that a url is generated for backup db.
and the command for restore:
$heroku pgbackups:restore --remote demo DATABASE 'heroku pgbackups:url'
**! Backup not found**
Just to be sure, I tried the following other formats of the command:
heroku pgbackups:restore --remote demo DATABASE 'heroku pgbackups:url --remote staging'
heroku pgbackups:restore --app demoapp DATABASE 'heroku pgbackups:url --app stagingapp'
They both are resulting in Backup not found error
I also tried with the name of the db on demo:
$heroku pgbackups:restore HEROKU_POSTGRESQL_ROSE 'heroku pgbackups:url --remote staging' --remote demo
! Backup not found
Please help!

Use backquotes instead of single quotes.
` heroku pgbackups:url -a source-app `

Log into your heroku control panel and make sure the version of PGbackup you have isn't depreciated

Related

Heroku ps:exec changes get reset after server restart

I wanted to create/change/command directly to the heroku app through heroku CLI, ps:exec command.
For example, I actually tried to update an spree(ecommerce framework written Rails) app I created using Heroku button. After I created the app with Heroku button, I found I need an extension,
spree_digital to create digital product. So I tried following steps:
heroku ps:exec -a spreeapp
$ # install nano editor here
$ nano Gemfile # added a line: gem 'spree_digital', github: 'spree-contrib/spree_digital'
$ bundle install
$ bundle exec rails g spree_digital:install # and no error.
$ exit
heroku ps:restart # the git repo says server restart is required so
heroku ps:exec -a spreeapp # and test if that the Gemfile is same as the line added one
$ cat Gemfile # and I found that the file I changed didn't change..
I'm new to Heroku, your each comment must be fuge help for me. Thanks.

How to avoid the --app option with heroku CLI?

I'm tired of entering the name of my app each time I run a heroku command in the terminal:
heroku run rake db:migrate --app myapp
heroku run rake db:seed --app myapp
heroku run rake sth:else --app myapp
The --app is very redundant and annoying, I didn't figured out where were the option to configure it globally once for the project.
heroku doesn't require the --app argument when it knows which app it should talk to. This occurs when there is exactly one Git remote pointing to Heroku for a repository.
You don't appear to have any remotes pointing to Heroku. Run
heroku git:remote --app myapp
to add such a remote. Once that's done you should be able to omit the --app argument for heroku commands on that particular repository.
If you prefer to do this yourself you can run
git remote add heroku git#heroku.com:myapp.git
Note that it's possible to have multiple Heroku remotes, e.g. if you have a staging and a production app. In this case you will also have to provide the --app argument to specify which one should be used.

Upgrading to cedar-14 when deploying via the heroku

I tried to migrate my app to cedar-14 stack, but when i do:
heroku stack:set cedar-14
i ve got the message: stack:set` is not a heroku command
What can i do please?
Thanks
Please use following command to move from cedar to cedar-14
heroku stack:migrate cedar-14 -a <app name>
This error indicates your version of the heroku toolbelt doesn't know this command. You should update to the latest version.
You can check the version you have installed with the heroku version command:
heroku version
heroku-toolbelt/3.42.20 (x86_64-darwin10.8.0) ruby/1.9.3
heroku-cli/4.26.1-bf7a4d8 (amd64-darwin) go1.5.1
The heroku update command should update you to the latest version. If that doesn't work, try reinstalling it from scratch: https://toolbelt.heroku.com/
You also need to make sure you aren't using the gem version of the toolbelt, which has been deprecated for several years. Uninstall it with the gem uninstall heroku command.

Some heroku commands couldn't find my application

I can find my apps in heroku apps command, and also do some command to read information from app like heroku addons --app appname.
But I couldn't find my apps in some command like heroku addons:add addon_name, heroku pg:reset.
Work commands
heroku apps:
=== My Apps
my_app_1
my_app_2
(Also I can see my apps in heroku web dashboard.)
heroku addons --app my_app_1(not in my_app_1 folder):
=== my_app_1 Configured Add-ons
shared-database:5mb
heroku addons(in my_app_1 folder):
=== my_app_1 Configured Add-ons
shared-database:5mb
Doesn't work commands
heroku addons:add sendgrid(in my_app_1 folder):
! No app specified.
! Run this command from an app folder or specify which app to use with --app
heroku pg:reset DATABASE --confirm my_app_1(in my_app_1 folder):
Resetting SHARED_DATABASE (DATABASE_URL)... failed
! Resource not found
Here is my environment.
Max OS X Lion (10.7.4)
rvm 1.13.8 (stable)
ruby 1.9.3p194
heroku 2.26.5
Adding the heroku's remote configuration to git did the trick for me. Validate if you have it configured with git remote -v on the terminal and you should get something like:
heroku git#heroku.com:your-app.git (fetch)
heroku git#heroku.com:your-app.git (push)
if you don't, add it with
git remote add heroku git#heroku.com:your-app.git
It looks like the latest version fo the Heroku gem (2.26.5) is broken. A workaround is to downgrade to 2.26.3.
gem uninstall heroku -v 2.26.5
gem install heroku -v 2.26.3
It looks like you have a conflict between the Heroku gem, and the Heroku Toolbelt. I'm guessing you have installed the Heroku Toolbelt, but still have the Heroku gem in your gem file.
Remove the Heroku gem from your Gemfile and save.
Run the bundle command to update your Gemfile.lock
In Terminal, run gem uninstall heroku (NOTE: there may be multiple versions of the Heroku gem installed, and you'll need to uninstall all of them.)
In Terminal, run heroku addons
If you get heroku: command not found then you don't have the Heroku Toolbelt installed.
Install the Heroku Toolbelt and run the command again.
NOTE: If you're not in the app's directory, you'll need to add --app myapp1 to the Heroku commands.
Hope this helps.

Heroku db:push problems

I'm trying to push my local Postgres db to my Heroku app, and following Heroku guide, I did heroku db:push but I get the following error:
leonsas#leonsas-VirtualBox:~$ heroku db:push
! Taps Load Error: cannot load such file -- sqlite3
! You may need to install or update the taps gem to use db commands.
! On most systems this will be:
!
! sudo gem install taps
I already tried sudo gem install taps, sudo gem install sqlite3, but I cant make it work. Any ideas why it's trying to load an sqlite3 db when I'm using postgres?
Taps is no longer the recommended tool to use when migrating data between postgres instances. Please give heroku-pg-transfer a try instead.
This will only work if you're using one of the production databases or the new Heroku postgres dev plan. If you're still on the older shared database plan I would suggest switching to the new dev plan.
First, find the URL to your db on Heroku:
$ heroku config:get DATABASE_URL
postgres://yada:yada#ec2-107-21-122-141.compute-1.amazonaws.com:5432/123
Then transfer from your local db to the heroku db:
$ heroku plugins:install https://github.com/ddollar/heroku-pg-transfer
$ heroku pg:transfer -f postgres://localhost/dbname -t postgres://yada:yada#ec2.../123
Since the heroku-pg-transfer tool utilizes postgres's native pg_dump facility it is a much more predictable and resilient tool.

Resources