diff --git a/content/100-getting-started/03-prisma-postgres/110-import-from-existing-database-postgresql.mdx b/content/100-getting-started/03-prisma-postgres/110-import-from-existing-database-postgresql.mdx index ab25559013..facd3f0831 100644 --- a/content/100-getting-started/03-prisma-postgres/110-import-from-existing-database-postgresql.mdx +++ b/content/100-getting-started/03-prisma-postgres/110-import-from-existing-database-postgresql.mdx @@ -163,11 +163,16 @@ You'll also need the Prisma Postgres connection URL from step 1, it should look prisma+postgres://accelerate.prisma-data.net/?api_key=ey... ``` -Open your terminal and set the `DATABASE_URL` environment variable to the value of your Prisma Postgres database URL (replace the `__API_KEY__` placeholder with the API key of your actual database connection URL): +If you already have a `.env` file in your current directory with `DATABASE_URL` set, the tunnel CLI will automatically pick it up, no need to manually export it. However, if you haven't set up a `.env` file, you'll need to set the `DATABASE_URL` environment variable explicitly. + +To set the environment variable - open your terminal and set the `DATABASE_URL` environment variable to the value of your Prisma Postgres database URL (replace the `__API_KEY__` placeholder with the API key of your actual database connection URL): ```terminal export DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=__API_KEY__" ``` +:::note +If you explicitly set `DATABASE_URL` in your terminal, that value will take precedence over the one in your `.env` file. +::: Next, start the TCP tunnel: diff --git a/content/100-getting-started/03-prisma-postgres/115-import-from-existing-database-mysql.mdx b/content/100-getting-started/03-prisma-postgres/115-import-from-existing-database-mysql.mdx index 2876e1b1d6..e9aedd031e 100644 --- a/content/100-getting-started/03-prisma-postgres/115-import-from-existing-database-mysql.mdx +++ b/content/100-getting-started/03-prisma-postgres/115-import-from-existing-database-mysql.mdx @@ -49,13 +49,18 @@ You'll need the Prisma Postgres connection URL from [step 1](/getting-started/pr ```no-copy prisma+postgres://accelerate.prisma-data.net/?api_key=ey... ``` +If you already have a `.env` file in your current directory with `DATABASE_URL` set, the tunnel CLI will automatically pick it up, no need to manually export it. However, if you haven't set up a `.env` file, you'll need to set the `DATABASE_URL` environment variable explicitly. -Open your terminal and set the `DATABASE_URL` environment variable to the value of your Prisma Postgres database URL (replace the `__API_KEY__` placeholder with the API key of your actual database connection URL): +To set the environment variable - open your terminal and set the `DATABASE_URL` environment variable to the value of your Prisma Postgres database URL (replace the `__API_KEY__` placeholder with the API key of your actual database connection URL): ```terminal export DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=__API_KEY__" ``` +:::note +If you explicitly set `DATABASE_URL` in your terminal, that value will take precedence over the one in your `.env` file. +::: + Next, start the TCP tunnel using the `@prisma/ppg-tunnel` package, by executing the following command: diff --git a/content/100-getting-started/03-prisma-postgres/120-upgrade-from-early-access.mdx b/content/100-getting-started/03-prisma-postgres/120-upgrade-from-early-access.mdx index 2a478c3e10..4642f4a1c4 100644 --- a/content/100-getting-started/03-prisma-postgres/120-upgrade-from-early-access.mdx +++ b/content/100-getting-started/03-prisma-postgres/120-upgrade-from-early-access.mdx @@ -75,15 +75,23 @@ which pg_restore If you installed PostgreSQL but still see a “command not found” error for pg_dump or pg_restore, ensure your installation directory is in your system’s PATH environment variable. ::: +:::note +Please make sure that you are installing Postgresql version 16. Other versions may cause errors during the backup and restore process. +::: ### 1.2. Connecting to the EA database directly with `@prisma/ppg-tunnel` In your terminal, run `npx @prisma/ppg-tunnel` to establish a secure tunnel to your Early Access database. -Set environment variable (with your actual EA database URL): +If you already have a `.env` file in your current directory with `DATABASE_URL` set, the tunnel CLI will automatically pick it up—no need to manually export it. However, if you haven't set up a `.env` file, you'll need to set the `DATABASE_URL` environment variable explicitly. + +To set environment variable (with your actual EA database URL): ```bash export DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=eyJhbGciOiJIUzI..." ``` +:::note +If you explicitly set `DATABASE_URL` in your terminal, that value will take precedence over the one in your `.env` file. +::: Run the tunnel: ```bash diff --git a/content/250-postgres/700-tooling.mdx b/content/250-postgres/700-tooling.mdx index 473873d00d..d9a98aba14 100644 --- a/content/250-postgres/700-tooling.mdx +++ b/content/250-postgres/700-tooling.mdx @@ -28,7 +28,9 @@ You can connect to your Prisma Postgres instance using third party database edit ### 1. Create a TCP tunnel to access Prisma Postgres directly -In your terminal, set the environment variable `DATABASE_URL` referring to your Prisma Postgres instance which you want to connect to (be sure to replace the `API_KEY` placeholder with the API key value of your Prisma Postgres instance): +If you already have a `.env` file in your current directory with `DATABASE_URL` set, the tunnel CLI will automatically pick it up, no need to manually export it. However, if you haven't set up a `.env` file, you'll need to set the `DATABASE_URL` environment variable explicitly. + +In your terminal, to set the environment variable `DATABASE_URL` referring to your Prisma Postgres instance which you want to connect to (be sure to replace the `API_KEY` placeholder with the API key value of your Prisma Postgres instance): @@ -53,6 +55,10 @@ set DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=API_KEY" +:::note +If you explicitly set `DATABASE_URL` in your terminal, that value will take precedence over the one in your `.env` file. +::: + Run the following command to connect to your Prisma Postgres instance via `@prisma/ppg-tunnel` package: