Troubleshooting Tip: How to solve the problem on FortiAnalyzer when PostgresSQL stuck during upgrade
| Description | This article describes how to solve the problem during FortiAnalyzer upgrade. |
| Scope | FortiAnalyzer v7.2.x, v7.4x, v7.6.x. |
| Solution | When trying to upgrade FortiAnalyzer, PostgresSQL maybe stuck at 41% with a console alert 'fail to upgrade postgres'.
diagnose sql status upgrade-db Upgrading log SQL database 41%, stage: [Upgrade] started at: Tue Jul 1 17:09:18 2025
This is happening when trying to upgrade FortiAnalyzer without an upgrade path. Check the upgrade path in the link:
Run the command below on the FortiAnalyzer that is having the issue and try to rebuild the database again:
execute sql-local rebuild-db
This command will cause the FortiAnalyzer to reboot, purge the analytics database, and start inserting the archive logs into the PostgreSQL/ClickHouse database. Although this procedure does not remove any log files, it is highly recommended to take a VM snapshot and/or back up the system configuration and log files to an external FTP server.
Since this will rebuild the SQL database for all ADOMs, it may take a long time to complete, depending on the volume of logs stored and the current system resources available. There is no way to speed up this process.
Related documents: |