I am sharing a MongoDB between a few heroku apps and would like to move the ownership/billing to another app.
I have tried attaching (heroku addons:attach) to the receiving app and then using the heroku addons:detach command on the billing app, but this doesn't work.
Heroku support just confirmed that it is not possible to change the billing app for an add-on.
You can attach the add-on to other apps, but if you delete the original billing app then it will instantly delete your database without warning - even if it is attached to other active apps.
Some add-ons like Postgres offer a fork option, so you may be able fork, reconnect to the new instance, and delete the old database. The Postgres fork command looks like:
heroku addons:create heroku-postgresql:standard-0 --fork the-old-app-name::HEROKU_POSTGRESQL_CHARCOAL --app the-new-app-name
Where HEROKU_POSTGRESQL_CHARCOAL is the ENV variable name of your old database on your old app.
Related
I am trying to get heroku setup locally on my new laptop to be able to access an existing heroku account that has two existing rails apps on it. I was able to install heroku cli locally and I was able to login to heroku. If I run "heroku apps" it lists my two apps. But two things I need help with:
1) I can't remember how to tell heroku which app the git repo in the current folder on my laptop should work with on heroku server. in other words, how do i "select" which app i want to current work with after logging into heroku.
2) when I tried running the "heroku config" command to list existing config vars after logging it it gave me some kind of error message. need some suggestions on what might be causing that too.
Sorry to not include screen shots of errors but on a different company right now. hopefully you can at least help me answer the first question.
Thanks,
Edward
ps. I found this Q&A, does the answer here apply to my question (1)?
How to link a folder with an existing Heroku app
The cause turned out to be that I needed to add the heroku app location as a remote repo using the heroku cli from within my local git repo I had created. I used the following command:
heroku git:remote -a thawing-inlet-61413
where "thawing-inlet-61413" is the name of the app. You can get this by running:
heroku apps
and it will list them.
reference: https://devcenter.heroku.com/articles/git#creating-a-heroku-remote
I forked a heroku application (on the cli, using heroku fork). However, when I checked the fork application's config vars, the DATABASE_URL that it's set to is exactly the same as in the original application which I forked.
Can I push database schema changes to the new fork without affecting the original application? Or is there a need to fork the database as well?
From the rather obscure warning in the Heroku documentation, it sounds like sometimes the Heroku Postgres setup in the target app is not 100% correct after forking your app (i.e. as you observed, your DATABASE_URL is still pointing at the original app's DB, instead of at the forked app's DB).
The remedy in this case is to promote the new DB (i.e. your new HEROKU_POSTGRESQL_COLOR_URL) to be the primary DB for the forked app, using heroku pg:promote, e.g:
heroku pg:promote HEROKU_POSTGRESQL_COLOR_URL --app theForkedApp
Please have a look.
rails#rails-desktop:~/rails/app$ heroku addons:add herokuconnect
Adding herokuconnect on app... failed
! That add-on plan is only available to select users.
I am unable to add this add-on.
Please describe that what is the issue.
Actually looks like heroku-postgresql has been updated to heroku-postgresql:hobby-dev
liango#LENOVO-PC D:\lianxi\shouter
> heroku addons:create heroku-postgresql:hobby-dev
Creating postgresql-globular-2767... done, (free)
Adding postgresql-globular-2767 to whispering-meadow-8682... done
Setting DATABASE_URL and restarting whispering-meadow-8682... done, v4
Database has been created and is available
! This database is empty. If upgrading, you can transfer
! data from another database with pg:copy
Use `heroku addons:docs heroku-postgresql` to view documentation.
liango#LENOVO-PC D:\lianxi\shouter
>
Give one try to add this addon from Heroku Addon Dashboard Interface.
This is because Heroku connect is available to selected business users.
And you have to tell business purpose to Heroku for using Heroku connect to get this addon.
I have a main app on heroku and another app A on git in location github:a.
I want to create, when it is necessary, copies of A as A1,A2,A3...AN as separate apps on heroku from my main app automatically with different parameters.
How can i do that?
Edit: This process should be done by my main app automatically.
Updating this answer due to Heroku command DEPRECATION:
heroku fork has been deprecated as a core command as of 12/01/2017.
You will need to install the heroku-fork plugin to continue using this command.
heroku plugins:install heroku-fork
Here is a link to the Github plugin repo.
Use heroku fork to copy an existing application, including add-ons, config vars, and Heroku Postgres data.
See this KB page: Forking Applications.
Heroku toolbelt now provides a fork method to clone an existing application, see my answer here :
how to clone a project on heroku
There is a new feature on Heroku called Review Apps. One can create copies of the app manually or set up automatic copies from new PRs on Github.
Read more at: https://devcenter.heroku.com/articles/github-integration-review-apps
Simply create new applications and push your code to them. If you need to copy data, checkout the pgbackups transfers.
For management purposes, check out this dev center article.
To do this programatically, you'll need to look at the Heroku gem, and then figure out a way of getting something to git push to the appropriate remote. I would be surprised if this was possible to be honest.
It's a pretty simple problem. I need to get my heroku CLI app working with an app I have. I already have the git repo checked out (from github though, not sure if that matters).
A google search suggests this page is the place to go to get help, but the page doesn't tell me anything useful:
http://devcenter.heroku.com/articles/heroku-command
If you've already checked out the code all you need to need is setup a git remote pointing at heroku.
Locate your apps Gtit url - easiest place is from the 'My Apps' on Heroku in the 'Git Repo' panel, it will look something like git#heroku.com:stark-beach-5145.git
Back in your local git repo do (replacing with your app URL):
git remote add heroku git#heroku.com:stark-beach-5145.git
Now you will be able to perform git push heroku etc.
However, if you just want to use heroku commands as long as you explicitly pass in the application name you don't actually need to perform steps 1 and 2 above. eg
heroku ps --app <appname>
would show you the running processes for your application etc. Here appname is the name of the app as listed on the 'My Apps' page.