Prepare your dbt project for Mage Pro
TLDR
Clone your dbt project into Mage Pro, connect it to your warehouse and install its packages. The result is a project ready for execution checks—not a completed production migration.
Introduction
Use the repository you already maintain. This walkthrough covers setup; keep the existing production workflow running while you validate the intended model outputs and operating transition.
Originally published August 27, 2025. These are configuration templates: replace the placeholders and check compatibility with your installed Mage, dbt and adapter versions.
Push your base Mage Pro project to GitHub
Create a GitHub repository for the base Mage Pro project:
- Create a new GitHub repo
- Authenticate and connect your Mage Pro cluster to the GitHub repo (check out this Mage Pro deployment and version-control guide for more details)
- Use the Git terminal in Mage Pro to push the base Mage Pro project to GitHub
You'll know it worked when you see the basic folder structures, and some example files like load_titanic.py in the repo.
Clone your dbt repository into Mage Pro
After connecting GitHub and pushing the base Mage Pro project, clone your dbt repository into the dbt directory:
- Navigate to the Mage Pro terminal or Mage Pro Git Terminal.
- In the Mage terminal, change to your project's
dbtdirectory:
mage_project=/path/to/mage_project
cd "$mage_project/dbt"
Set mage_project to your actual absolute Mage project path. Use the same shell session for the commands below.
- Clone your dbt repository into that directory:
git clone \
https://github.com/ORG/REPO.git
Replace ORG and REPO with your GitHub organization and repository name. Git creates the REPO directory inside dbt.
- Refresh the file editor and locate the cloned dbt project directory.
Configure the cloned project
The profile field in dbt_project.yml selects a named entry in profiles.yml. It does not have to match the folder name. For example:
profile: YOUR_PROFILE_NAME
Check the existing project and profile names:
- Open the Mage Pro editor and navigate to your
dbt_project.ymlfile. - Keep the project name and set
profileto the entry you intend to use. - Save the file.
Configure that entry for your warehouse and development target. Inspect any existing configuration before editing it; preserve settings used by other work. The example below uses BigQuery.
- Choose this project's profile entry and development target.
- Replace the uppercase placeholders with your own values.
- Save the file.
YOUR_PROFILE_NAME:
outputs:
dev:
dataset: YOUR_DATASET
job_execution_timeout_seconds: 300
job_retries: 1
keyfile: /secure/key.json
location: US
method: service-account
priority: interactive
project: YOUR_PROJECT_ID
threads: 4
type: bigquery
target: dev
YOUR_PROFILE_NAME must match the project's profile field. Keep the credential file outside version control and use your environment's approved authentication method. Check the BigQuery adapter setup reference for your installed version.
Place profiles.yml in the dbt project root, as described in Mage's connection-profile documentation: for example, MAGE_PROJECT/dbt/REPO/profiles.yml. The CLI commands below select that directory explicitly with --profiles-dir; see the dbt profile reference for version-specific lookup behavior.
Testing your connection
With the dbt CLI installed in your environment, run dbt debug to inspect the warehouse connection and local setup:
- Navigate to your Mage terminal.
- Enter the cloned project directory containing
dbt_project.ymlandprofiles.yml:
cd "$mage_project/dbt/REPO"
Use the same mage_project variable and replace REPO with the cloned repository directory name.
- Run the connection checks:
dbt debug --profiles-dir . --target dev
Replace dev if you configured a different target.
- Inspect the configured profile, target and individual check results.
If a check fails, use its reported reason to inspect the profile directory, named entry, target and credentials.
From the same directory, install the project's declared packages:
dbt deps
Use the package files supported by your installed dbt version. The dbt deps reference describes package installation.
What these setup commands establish
| Command | What a passing result establishes |
|---|---|
dbt debug | Checks the configured database connection, local project configuration and system setup. |
dbt deps | Installs the project's declared packages; inspect the actual installation result. |
Neither command runs the intended model graph or moves production scheduling.
Conclusion
Before changing production, verify the project revision, connection and package installation, then validate the intended model outputs and operating transition.
Plan execution validation in an approved environment. The official dbt build reference covers running selected resources and their tests.





