node.jsherokuheroku-connect

How do I migrate heroku connect mappings from staging to prod


I asked the same question on salesforce.stackexchange a few days ago, but no response so far. So trying here as well. Question is; How do I migrate Heroku-connect mappings from e.g. staging to prod when doing promote in my pipeline? The project per now is just a small web api to be used by a mobile app, implemented in node.js. Using heroku-connect for fetch of salesforce data only.


Solution

  • There is not a way to automatically migrate/promote mappings. You can export an existing mapping using the Heroku Connect API or Toolbelt Plugin: https://devcenter.heroku.com/articles/heroku-connect-api#step-7-import-a-mapping-configuration

    heroku connect:export -a your-staging-app  # Outputs JSON based on app+database name
    heroku connect:import name_of_output_file.json -a your-prod-map
    

    You could set this up as a release script or something if you wanted it to be automatic, though you would have to install the Heroku Toolbelt Plugin: https://elements.heroku.com/buildpacks/ksiggins/heroku-buildpack-toolbelt