<@ULVA73B9P> how do i migrate prefect server datab...
# ask-marvin
y
@Marvin how do i migrate prefect server database so that the new prefect server can have the data of the old
m
To migrate your Prefect server database to a new server while keeping the data from the old one, here's what you need to do: 1. Run Database Migration - Make sure your Prefect server installation includes the correct versions. - Use the
prefect server database upgrade -y
command to apply the migrations to your database. Details here. 2. Set Up Database Connection - Configure your Prefect profile to point to the PostgreSQL database instance on your new server:
Copy code
prefect config set PREFECT_API_DATABASE_CONNECTION_URL="<postgresql+asyncpg://username:password@new_host:5432/prefect>"
- Confirm the configuration with:
Copy code
prefect config view --show-sources
- Start the Prefect server:
Copy code
prefect server start
- More instructions are available here. 3. Transfer Workspace Data - Review the impacts and steps necessary to ensure all your data, including users, API keys, and accounts, are correctly transferred or updated. This will involve ensuring access, tracking activity, and any potential resources or costs might change. For a detailed guide on database migration, refer to the documentation and make sure to check the linked GitHub issues for any intermittent problems or updates. Links: - Overview of Database Migrations: https://docs.prefect.io/latest/contributing/overview/ - PostgreSQL Configuration Guide: https://docs.prefect.io/latest/guides/host/ - GitHub Discussion on Migration: https://github.com/PrefectHQ/prefect/issues If you face any issues during these steps, checking the logs for specific errors and consulting GitHub issues related to your problem might be helpful.