Heroku Setup Requirements
To set up Heroku in Stitch, you need:
A Heroku account. You can create an account by clicking here or entering
https://signup.heroku.comin your browser.
Contact Heroku if you have questions about their pricing, product features, or support.
Step 1: Create a Heroku Database
In this first step, you’ll create and provision a Heroku database.
- Sign into your Heroku account.
- Navigate to the Databases page by clicking the Options menu (the grid icon next to your avatar in the upper right corner) then Databases.
- Click the Create Database button in this screen.
- In the Plan prompt, select the plan you want to use.
- Select the Region for the database by clicking the Default Region drop-down menu.
- Click Add Database.
Heroku will begin the database provisioning process, which can take a few minutes. The status of your database will change to Available in the Database Dashboard page when things are complete:
Step 2: Locate the Heroku Database Connection Settings
Next, you’ll locate the database settings in Heroku. This info will be used in the last section to connect Stitch to your Heroku-Postgres destination.
- On the Heroku Database Dashboard page, click the database you just created.
The database settings and credentials will display. Everything you need is in the Connection Settings section of this page:
- Remember to click the Show link next to the Password field to retrieve the user’s password.
Leave this page open for now - you’ll need it to wrap things up.
Step 3: Grant the Heroku user CREATE permissions
CREATE permissions to create integration schemas and tables in your destination and load data. By default, Heroku credentials don’t include
CREATE permissions, so you’ll need to grant them to the database user before continuing.
Connect to your Heroku instance using a SQL client and the credentials you retrieved in Step 2.
After connecting, you’ll assign the
CREATEpermissions to the user. This allows Stitch to create integration schemas and tables in the specified database.
Run the following command, replacing
<heroku_database_user>with the Database and User values from Step 2, respectively:
GRANT CREATE ON DATABASE <heroku_database_name> TO <heroku_database_user>
Step 4: Connect Stitch
Lastly, you’ll enter Heroku’s connection details into Stitch. When you do this, you’ll use the PostgreSQL destination option, as noted below.
- If you aren’t signed into your Stitch account, sign in now.
- Click the Destination tab.
- Click the PostgreSQL icon.
Fill in the fields as follows:
Host (Endpoint): Paste the host of the Heroku database.
Port: Paste the port used by the Heroku database.
Username: Paste the username of the Heroku database user.
Password: Paste the password of the Heroku database user.
Database: Paste the name of the Heroku database.
Connect using SSL: Check this box. Heroku requires SSL to connect - if left unchecked, Stitch will be unable to connect to your Heroku database.
When finished, click Update PostgreSQL Settings.
Stitch will perform a connection test to the PostgreSQL database; if successful, a Success! mesage will display at the top of the screen. Note: This test may take a few minutes to complete.
Troubleshooting connection errors
If you receive an error message, we recommend:
- Verifying that the Connect using SSL box in the Destination Settings page is checked. Heroku requires SSL to be enabled for the connection to be successful.
- Checking Heroku’s Status Page for possible service outages.
If the errors persist, reach out to support.
Learning about Stitch and PostgreSQL
Now that your PostgreSQL data warehouse is up and running, we recommend learning about how Stitch will load your data into it.
PostgreSQL Destination Overview: This overview will give you the high-level basics for working with your PostgreSQL data warehouse.
Destination Data Loading Guide: This article covers many of the common scenarios Stitch will encounter when loading data into your PostgreSQL destination and the expected behavior for each scenario.