I have a fully working application with data persisted in the database but I need to change the github repository associated with it. So I have something like:
https://github.com/foo/bar
And I need to change to:
https://github.com/bar/foo
Without doing anything to the application hosted and without losing data. Is there any way to do this?
1 Answer 1
If you're using Heroku's Github integration (where Heroku either automatically deploys a specific Github branch or you can choose a branch to deploy manually) you can disconnect your old repository and connect the new one. Navigate to Deploys tab, and click the Disconnect... button in App connected to Github section:
Then connect your new repository as you did initially.
Note that if your repository was transferred to another account / organization you may need to grant Heroku permissions to access that. When you do so and reconnect the repository you may find two Heroku webhooks installed, under Settings / Webhooks on Github. One of those will be shown as failing - just remove the one that fails.
AandBshare history?B. Heroku doesn't know what machine or directory you pushed from.