<@ULVA73B9P> how to migrate database from one vers...
# marvin-ai
l
@Marvin how to migrate database from one version to the next ?
m
thought for 45.2 seconds
Here's how to migrate your Prefect database to a new version: 1. Using the CLI (Recommended Method):
Copy code
bash
prefect server database reset-db
This command will automatically handle the migration to the latest version. 2. Environment Configuration: Before migrating, especially for large databases, set an adequate timeout:
Copy code
bash
export PREFECT_API_DATABASE_TIMEOUT=300  # 5 minutes, adjust as needed
3. For Docker Deployments: If you're running Prefect in Docker, include the timeout in your docker run command:
Copy code
bash
docker run -e PREFECT_API_DATABASE_TIMEOUT=300 prefecthq/prefect:latest
Important Safety Tips: - Always backup your database before performing migrations - Ensure no active workflows are running during the migration - For production environments, consider testing the migration in a staging environment first If you encounter any issues during migration or need to perform more complex operations (like rolling back to a previous version), let me know and I can provide more specific guidance. For more details, you can refer to the server database documentation.