Upgrade Infrahub Community
The process to migrate your instance of Infrahub to the latest version will vary depending on your deployment of Infrahub. However, at a high-level, it will involve getting the latest version of the Infrahub code, and then performing any needed Database Migrations and Schema updates.
For installation instructions, please refer to our Installation Guide.
Follow the instructions below for your current release version and deployment method.
info
Even though a "smooth" migration is anticipated, we nonetheless strongly suggest creating a backup beforehand. For detailed information, see our Backup Guide.
Upgrading to Infrahub 1.2 and after
In version 1.2 the upgrade process has been streamlined with a unified upgrade command:
- Docker
- Helm
- Dev/Demo
# Bring down the current environment
docker compose down
# Pull the new docker-compose file
curl https://infrahub.opsmill.io > docker-compose.yml
# Run the unified upgrade command
docker compose run infrahub-server infrahub upgrade
# Bring the environment back up
docker compose up -d
# Upgrade the Helm release
helm upgrade
# Run the unified upgrade command inside the server pod
kubectl exec infrahub-infrahub-server-xxxxxx -- infrahub upgrade
# Restart deployments to apply changes
kubectl rollout restart deployment/prefect-server
kubectl rollout restart deployment/infrahub-infrahub-server
# Stop the current instance
invoke demo.stop
# Rebuild and run the unified upgrade command
invoke demo.build
invoke demo.migrate
# Restart the instance
invoke demo.start
Or for a clean instance (warning: all data will be lost):
invoke demo.destroy demo.build demo.start demo.load-infra-schema demo.load-infra-data
Upgrading to Infrahub 1.1 and before
- Docker
- Helm
- Dev/Demo
# Bring down the current environment
docker compose down
# Pull the new docker-compose file
curl https://infrahub.opsmill.io > docker-compose.yml
# Run database migrations and schema update
docker compose run infrahub-server infrahub db migrate
docker compose run infrahub-server infrahub db update-core-schema
# Bring the environment back up
docker compose up -d
# Upgrade the Helm release
helm upgrade
# Run migrations and update the core schema
kubectl exec infrahub-infrahub-server-xxxxxx -- infrahub db migrate
kubectl exec infrahub-infrahub-server-xxxxxx -- infrahub db update-core-schema
# Restart deployments to apply changes
kubectl rollout restart deployment/prefect-server
kubectl rollout restart deployment/infrahub-infrahub-server
# Stop the current instance
invoke demo.stop
# Rebuild and run migrations
invoke demo.build
invoke demo.migrate
# Restart the instance
invoke demo.start