This article records configuration and changes from a historical FastGPT release. Use it to understand that release, and consult the release notes for your installed and target versions before applying dependencies, configuration, or migration steps.
Overview of V4.1 Database Configuration Update
FastGPT version 4.1 simplified database connection configuration by replacing fragmented individual host, port, and credential variables for both MongoDB and PostgreSQL with unified connection URI strings. This update reduces configuration complexity while preserving compatibility with existing database deployments, provided the configured database names match your prior setup.
Mandatory Configuration Notes
Two fixed database path segments are required in the new URI formats to align with your existing database setup:
/fastgpt: The target MongoDB database name, which must exactly match the value used in your previous configuration/postgres: The target PostgreSQL database name, which must exactly match the value used in your previous configuration
Standard Connection URI Parameters
Below are the exact required environment variables and their example values for the updated configuration:
| Variable Name | Example URI Value |
|---|---|
MONGODB_URI | mongodb://username:password@mongo:27017/fastgpt?authSource=admin |
PG_URL | postgresql://username:password@pg:5432/postgres |
A supported troubleshooting action: If your MongoDB connection fails after applying the new URI, remove the ?authSource=admin query string from the MONGODB_URI value.
Step-by-Step Migration Workflow
- Locate your FastGPT deployment’s active environment variable storage: this may be a root
.envfile,docker-compose.ymlenvironment block, or managed environment variable service. - Remove all legacy separate MongoDB connection variables and replace them with the single
MONGODB_URIvariable, using the provided example format. - Remove all legacy separate PostgreSQL connection variables and replace them with the single
PG_URLvariable, using the provided example format. - Verify that the database path segments in both URIs match your existing database names.
- If you encounter MongoDB connection errors, edit the
MONGODB_URIto remove the?authSource=adminquery string. - Restart your FastGPT deployment to activate the updated environment variables.