diff --git a/docs/self-hosting/deployment-options/linux-upgrade.mdx b/docs/self-hosting/deployment-options/linux-upgrade.mdx index 2ba8a3f41..6712626bd 100644 --- a/docs/self-hosting/deployment-options/linux-upgrade.mdx +++ b/docs/self-hosting/deployment-options/linux-upgrade.mdx @@ -1,6 +1,6 @@ --- -title: "Upgrading Linux Package" -description: "Learn how to upgrade your Infisical deployment on Linux" +title: "Upgrading" +description: "How to upgrade Infisical deployment using linux package" --- This guide explains how to upgrade Infisical Linux package installations to newer versions. @@ -141,43 +141,50 @@ This approach ensures users/machines do not experience sudden connection errors #### On the deploy node: -1. **Drain traffic from the node**: + + - Depending on your load balancer, use one of the following approaches to drain the node: - - - If using NGINX as a load balancer, you can remove the server from the upstream pool temporarily: - ```bash - # Edit your NGINX configuration to comment out or remove the server - sudo nano /path/to/your/nginx-config.conf - - # Reload NGINX to apply changes - sudo nginx -s reload - ``` - - - If using HAProxy, you can put the server in maintenance mode: - ```bash - # Using the HAProxy socket command - echo "disable server infisical_backend/infisical-node1" | socat stdio /var/lib/haproxy/stats - ``` - - - Deregister the instance from the load balancer using the AWS console or CLI - - - Follow your load balancer's documentation for instructions on draining procedure - - +Drain the traffic on this node gracefully. You can do this in a number of ways depending on the load balancer you have configured. +Approaches for some common load balancers are provided below: -2. **Verify no new traffic is arriving ** before proceeding with the upgrade. + + + If using NGINX as a load balancer, you can remove the server from the upstream pool temporarily: + ```bash + # Edit your NGINX configuration to comment out or remove the server + sudo nano /path/to/your/nginx-config.conf + + # Reload NGINX to apply changes + sudo nginx -s reload + ``` + + + If using HAProxy, you can put the server in maintenance mode: + ```bash + # Using the HAProxy socket command + echo "disable server infisical_backend/infisical-node1" | socat stdio /var/lib/haproxy/stats + ``` + + + Deregister the instance from the load balancer using the AWS console or CLI + + + Follow your load balancer's documentation for instructions on draining procedure + + + -3. **Stop Infisical on this node**: - ```bash - infisical-ctl stop - ``` + +Verify no new traffic is arriving before proceeding with the upgrade. + -4. **Upgrade the Infisical package**: + +```bash +infisical-ctl stop +``` + + + To upgrade to the latest version: @@ -208,39 +215,44 @@ To upgrade to a specific version: ``` + -5. **Apply configuration and start the service**: - ```bash - infisical-ctl reconfigure - ``` + +```bash +infisical-ctl reconfigure +``` + -6. **Verify the upgrade and migration success**: - ```bash - infisical-ctl tail - ``` - Look for successful migration messages in the logs. + +```bash +infisical-ctl tail +``` +Look for successful migration messages in the logs. + -7. **Return the node to service** once you've verified it's running correctly: - - Re-enable the server in your load balancer using the same method you used to remove it. + +Re-enable the server in your load balancer using the same method you used to remove it. + + #### On all remaining nodes (one at a time): -1. **Drain traffic from the node** being upgraded: + + +Follow the same draining procedure as described for the deploy node: - Follow the same draining procedure as described for the deploy node: - - - Remove the server from your load balancer's active pool - - Wait for existing connections to complete - - Verify the node is no longer receiving traffic +- Remove the server from your load balancer's active pool +- Wait for existing connections to complete +- Verify the node is no longer receiving traffic + -2. **Stop Infisical on this node**: - ```bash - infisical-ctl stop - ``` + +```bash +infisical-ctl stop +``` + -3. **Upgrade the Infisical package**: - + To upgrade to the latest version: @@ -270,38 +282,89 @@ To upgrade to a specific version: ``` + -4. **Apply configuration and start the service**: - ```bash - infisical-ctl reconfigure - ``` + +```bash +infisical-ctl reconfigure +``` + -5. **Verify the upgrade success**: - ```bash - infisical-ctl status - infisical-ctl tail - ``` + +```bash +infisical-ctl status +infisical-ctl tail +``` + -6. **Wait for service to be fully operational**: - - Check logs to ensure the service has started successfully - - Verify it can connect to the database and Redis + +- Check logs to ensure the service has started successfully +- Verify it can connect to the database and Redis + -7. **Return the node to service**: - - Re-enable the server in your load balancer using the same method you used to remove it. + +Re-enable the server in your load balancer using the same method you used to remove it. + -8. **Verify traffic is flowing correctly** by checking logs and monitoring. + +Check logs and monitoring to ensure traffic is flowing correctly. + -8. **Repeat** steps 1-7 for each remaining node, one at a time. + +Repeat steps 1-7 for each remaining node, one at a time. + -9. **After all nodes are upgraded**, verify that the application is functioning correctly: - - Test core functionality - - Check logs for any errors + +After all nodes are upgraded, verify that the application is functioning correctly: +- Test core functionality +- Check logs for any errors + + + +## Rolling Back + +If you need to roll back to a previous version of Infisical, follow steps below. + + + +```bash +infisical-ctl stop +``` + + + +For Debian/Ubuntu: +```bash +sudo apt-get install -y infisical-core= +``` + +For RHEL/CentOS/Amazon Linux: +```bash +sudo yum downgrade infisical-core- +``` + + + +Restore your Postgres/Redis database from backup. + + + +```bash +infisical-ctl reconfigure +``` + + + +```bash +infisical-ctl status +``` + + ## Troubleshooting -### Migration Issues - + + If you encounter database migration issues: 1. Check the logs: @@ -311,48 +374,17 @@ If you encounter database migration issues: 2. Ensure the database user has sufficient privileges to create/modify tables. -3. If migrations fail repeatedly, consider restoring from the backup you took prior to upgrading. +3. If migrations fail repeatedly, consider restoring from the backup you took prior to upgrading. -### Service Won't Start After Upgrade + + 1. Check for configuration errors: ```bash - infisical-ctl status infisical-ctl tail + infisical-ctl status ``` 2. Verify all required environment variables are set in your `/etc/infisical/infisical.rb` file. - - -## Rolling Back - -If you need to roll back to a previous version of Infisical, follow steps below. - -1. Stop the Infisical service: - ```bash - infisical-ctl stop - ``` - -2. Install the previous version: - - For Debian/Ubuntu: - ```bash - sudo apt-get install -y infisical-core= - ``` - - For RHEL/CentOS/Amazon Linux: - ```bash - sudo yum downgrade infisical-core- - ``` - -3. Restore your database from backup. - -4. Start the service: - ```bash - infisical-ctl reconfigure - ``` - -5. Verify the rollback: - ```bash - infisical-ctl status - ``` \ No newline at end of file + + \ No newline at end of file