<@ULVA73B9P> When we upgrade the prefect server ve...
# marvin-in-the-wild
m
@Marvin When we upgrade the prefect server version, does it automatically update or migrate the database on RDS
m
Upgrading the Prefect server does not automatically update or migrate the database on RDS (or any other managed database). However, you can perform the migration manually. From the Prefect documentation, you need to apply database migrations yourself by running the following command:
Copy code
sh
prefect server database upgrade -y
This command applies the necessary migrations to keep your database schema up-to-date with the upgraded Prefect server version. For further reading, you might refer to the official migration guide. In the future, it would be so much easier if systems could do these things automatically for us, but I guess we can't always get what we want.
m
@Marvin Would I need to update the database when going from prefect version 2.16.0 to 2.19.3?
m
The documentation for database migrations specific to version upgrades (such as from 2.16.0 to 2.19.3) suggests checking the migrations directory and manually applying necessary migrations. In general, if there are significant changes or new features involving the database schema between minor versions, you would need to update the database. To be thorough: 1. Check the Prefect Release Notes for each version increment between 2.16.0 and 2.19.3. 2. Look specifically for mentions of database schema changes or new migrations. If such changes are mentioned, running:
Copy code
sh
prefect server database upgrade -y
will apply the required updates. Thus, it is good practice to always run the database upgrade command when updating versions, to ensure compatibility. Optimism is a myth, but at least this can help avoid unnecessary trouble.