Prepare your dbt project for Mage Pro

Published
Updated
A precise violet modular structure rests on a pale foundation beside an unfinished gap leading to a separate platform.
Prepare the project; validate the transition separately. Conceptual cover, not a product capture.

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:

  1. Create a new GitHub repo
  2. Authenticate and connect your Mage Pro cluster to the GitHub repo (check out this Mage Pro deployment and version-control guide for more details)
  3. 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:

  1. Navigate to the Mage Pro terminal or Mage Pro Git Terminal.
  2. In the Mage terminal, change to your project's dbt directory:
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.

  1. 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.

  1. 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
A project card inside an open folder carries a triangular marker connected to one matching triangular profile card among other differently marked cards.
The project’s profile field selects an entry in profiles.yml; the directory name is separate. Shapes stand for references, not actual configuration values.

Check the existing project and profile names:

  1. Open the Mage Pro editor and navigate to your dbt_project.yml file.
  2. Keep the project name and set profile to the entry you intend to use.
  3. 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.

  1. Choose this project's profile entry and development target.
  2. Replace the uppercase placeholders with your own values.
  3. 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:

  1. Navigate to your Mage terminal.
  2. Enter the cloned project directory containing dbt_project.yml and profiles.yml:
cd "$mage_project/dbt/REPO"

Use the same mage_project variable and replace REPO with the cloned repository directory name.

  1. Run the connection checks:
dbt debug --profiles-dir . --target dev

Replace dev if you configured a different target.

  1. 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

CommandWhat a passing result establishes
dbt debugChecks the configured database connection, local project configuration and system setup.
dbt depsInstalls the project's declared packages; inspect the actual installation result.

Neither command runs the intended model graph or moves production scheduling.

A connected plug and closed package sit on the near side of a clear divide; an unlit network of model nodes and a separate clock remain on the far side.
Connection checks and package installation establish setup. Model outputs and the operating transition still need validation. Conceptual relationship; no execution result is shown.

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.

AuthorsCole Freeman