Search code examples
sqldatabaseetldbt

How to set location of profiles.yml and dbt_project.yml files in DBT?


Running dbt debug --config-dir shows the incorrect location.

E.g.)

12:35:52  Running with dbt=1.0.3
12:35:52  To view your profiles.yml file, run:

open /The/wrong/directory

How do I tell DBT that I've moved the profiles.yml & dbt_project.yml files?


Solution

  • dbt run --help shows that there are two flags for this specific purpose.

      --project-dir PROJECT_DIR
                            Which directory to look in for the dbt_project.yml file. Default is the current working directory and its parents.
      --profiles-dir SUB_PROFILES_DIR
                            Which directory to look in for the profiles.yml file. Default = /Users/username/.dbt
    

    The command you'll want to run is:

    dbt run --project-dir /path/to/new --profiles-dir /path/to/new