Create a new Heroku app from an existing Heroku app

1. Delink the existing app

# Remember original heroku URL

saasbook@saasbook:~/git/heroku/myror1$
git remote show heroku
* remote heroku
  Fetch URL: git@heroku.com:myror1.git
  Push  URL: git@heroku.com:myror1.git
  HEAD branch: master
  Remote branch:
    master new (next fetch will store in remotes/heroku)
  Local ref configured for 'git push':
    master pushes to master (up to date)

# Now delink from heroku repository

git remote rm heroku

2. Create a copy on Heroku

# Create new Heroku app using current app:

heroku create --app myror2
Creating myror2... done, stack is cedar
http://myror2.herokuapp.com/ | git@heroku.com:myror2.git
Git remote heroku added

# Push existing code to new Heroku app

git push heroku master

# Confirm!

git remote show heroku
* remote heroku
  Fetch URL: git@heroku.com:myror2.git
  Push  URL: git@heroku.com:myror2.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local ref configured for 'git push':
    master pushes to master (up to date)

3. Restore Heroku URL for local copy of the original app

# Delink new app

saasbook@saasbook:~/git/heroku/myror1$
git remote rm heroku

# Restore original

saasbook@saasbook:~/git/heroku/myror1$
git remote add heroku git@heroku.com:myror1.git
git remote show heroku
* remote heroku
  Fetch URL: git@heroku.com:myror1.git
  Push  URL: git@heroku.com:myror1.git
  HEAD branch: master
  Remote branch:
    master new (next fetch will store in remotes/heroku)
  Local ref configured for 'git push':
    master pushes to master (up to date)

4. Import newly created Heroku  project into Eclipse 

# Start using it in Eclipse
Eclipse -> Import Existing Heroku App -> Auto detected project.
Select myror2


No comments:

Post a Comment