No matter what I do retooldb uses virtual conainer and NOT my external cluster

  1. My goal:For Retool to use actual environment variables to connect to Retool db using them. Instead it uses retooldb-postgres:5432/ even when I removed this container from compose.yaml and specified credentials in retooldb.env

  2. What I’ve tried so far: tried moving # Retool DB credentials into main docker.env and back to retooldb.env. It ignores them. I assume the issue may be that I have initially created a Retool instance, and the RetoolDB was a container. But then I decided to migrate to an external cluster, but it got cached somehow within the Retool, and now it only looks for local containers or creates them automatically.

  3. I have also tried deleting from the postgres database the row from resources about Retool database. Nothing helps. Now there is no container. I have external credentials within the environment file. I have restarted the server like five times. But when I open resources and open RetoolDB, it still somehow opens something even though there is no freaking container. And it still works, but it is not my external database, which is very annoying.

Hello @JimmyS,

Just to be clear on your goal, you want to reconfigure the Retool DB resource to use your own DB instead of the standard DB that self hosted instances spin up with by default, correct?

I believe this issue is due to a misunderstanding about two databases that Retool uses.

RetoolDB is NOT the same as Retool's backend/storage database. There are actually TWO separate databases in a Retool deployment:

  1. Retool's Backend Database (storage database) - This stores Retool's configuration, apps, users, etc. This is what the environment variables in retooldb.env control (like POSTGRES_HOST, POSTGRES_DB, POSTGRES_USER, etc.)
  2. RetoolDB (the resource) - This is a built-in PostgreSQL resource that appears in the Resources panel of Retool. It's meant as a convenience database for prototyping/demos and is separate from the backend database.

So I believe you may be trying to change 1 when you mean to change 2. With the code creating a new 1 from scratch to fill with app configuration.

What variable did you change in retooldb.env ?

Is Retool itself functioning normally?

  • Can you log in, create apps, save changes?
  • If yes, then the backend database migration might actually be working

When you open "RetoolDB" in Resources, what connection details do you see?

  • This will help confirm whether it's still pointing to a (now non-existent) local container

What's in your docker-compose.yml now?

  • Specifically, what does the api service's environment variables section look like?