Upgrading SOAR failed at DatabaseSchema phase with Error "Failed to apply database migrations".

1. "ModuleNotFoundError: No module named 'soar_diag_backport'" was found in the phantom_install.log
$ tail -4 /opt/phantom/var/log/phantom/phantom_install_log
{"component": "installation_log", "time": "2025-07-07T14:04:48.194389", "logger": "install.console", "pid": 117923, "level": "DEBUG", "file": "/opt/phantom/splunk-soar/install/console.py", "line": 270, "message": "Subprocess completed.", "install_run_uuid": "6d87f1da-d62c-47b4-a221-b7520f861df4", "start_time": "2025-07-07T13:56:06.519944", "install_mode": "upgrade", "installed_version": "6.3.1.178", "proposed_version": "6.4.1.361", "deployment_type": "unpriv", "continue_from": null, "phase": "deploy", "operation_start_time": "2025-07-07T14:04:46.754709", "operation_name": "DatabaseSchema", "operation_status": "started", "operation_type": "task", "operation_cluster_phase": "ClusterPhase.NONE", "log_type": "subprocess", "command": "/opt/phantom/bin/phenv python3 -m manage migrate", "environment_variables": {"LANG": "en_US.UTF-8", "HOME": "/home/myphantomuser", "PATH": "/opt/phantom/usr/bin:/opt/phantom/lib3/pip/soar-packages/bin:/opt/phantom/bin:/opt/phantom/usr/postgresql/15/bin:/opt/phantom/usr/python39/bin:/opt/phantom/usr/perl/bin:/opt/phantom/usr/pgbackrest/bin:/opt/phantom/usr/erlang/bin:/opt/phantom/usr/rabbitmq/sbin:/home/myphantomuser/.local/bin:/home/myphantomuser/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin"}, "status": "failed", "exit_code": 1, "stdout": [], "stderr": ["Traceback (most recent call last):", " File \"/opt/phantom/usr/python39/lib/python3.9/runpy.py\", line 197, in _run_module_as_main", " return _run_code(code, main_globals, None,", " File \"/opt/phantom/usr/python39/lib/python3.9/runpy.py\", line 87, in _run_code", " exec(code, run_globals)", " File \"/opt/phantom/www/manage.py\", line 22, in <module>", " execute_from_command_line(sys.argv)", " File \"/opt/phantom/usr/lib/platform/lib/python3.9/site-packages/django/core/management/__init__.py\", line 442, in execute_from_command_line", " utility.execute()", " File \"/opt/phantom/usr/lib/platform/lib/python3.9/site-packages/django/core/management/__init__.py\", line 416, in execute", " django.setup()", " File \"/opt/phantom/usr/lib/platform/lib/python3.9/site-packages/django/__init__.py\", line 24, in setup", " apps.populate(settings.INSTALLED_APPS)", " File \"/opt/phantom/usr/lib/platform/lib/python3.9/site-packages/django/apps/registry.py\", line 91, in populate", " app_config = AppConfig.create(entry)", " File \"/opt/phantom/usr/lib/platform/lib/python3.9/site-packages/django/apps/config.py\", line 193, in create", " import_module(entry)", " File \"/opt/phantom/usr/python39/lib/python3.9/importlib/__init__.py\", line 127, in import_module", " return _bootstrap._gcd_import(name[level:], package, level)", " File \"<frozen importlib._bootstrap>\", line 1030, in _gcd_import", " File \"<frozen importlib._bootstrap>\", line 1007, in _find_and_load", " File \"<frozen importlib._bootstrap>\", line 984, in _find_and_load_unlocked", "ModuleNotFoundError: No module named 'soar_diag_backport'"], "time_elapsed_since_start": 521.67452, "time_elapsed_since_operation_start": 1.43976}
{"component": "installation_log", "time": "2025-07-07T14:04:48.194701", "logger": "install.operations.deployment_operation", "pid": 117923, "level": "DEBUG", "file": "/opt/phantom/splunk-soar/install/operations/deployment_operation.py", "line": 144, "message": "Completed upgrade task operation", "install_run_uuid": "6d87f1da-d62c-47b4-a221-b7520f861df4", "start_time": "2025-07-07T13:56:06.519944", "install_mode": "upgrade", "installed_version": "6.3.1.178", "proposed_version": "6.4.1.361", "deployment_type": "unpriv", "continue_from": null, "phase": "deploy", "operation_start_time": "2025-07-07T14:04:46.754709", "operation_name": "DatabaseSchema", "operation_status": "failed", "operation_type": "task", "operation_cluster_phase": "ClusterPhase.NONE", "time_elapsed_since_start": 521.674781, "time_elapsed_since_operation_start": 1.440019}
{"component": "installation_log", "time": "2025-07-07T14:04:48.194943", "logger": "install", "pid": 117923, "level": "DEBUG", "file": "/opt/phantom/splunk-soar/install/meta.py", "line": 280, "message": "Adding deployment state to metadata", "continue_from": "DatabaseSchema", "cluster_phase": "ClusterPhase.NONE", "installed_version": "6.3.1.178", "installed_os_family": "el8", "install_run_uuid": "6d87f1da-d62c-47b4-a221-b7520f861df4", "start_time": "2025-07-07T13:56:06.519944", "install_mode": "upgrade", "proposed_version": "6.4.1.361", "deployment_type": "unpriv", "time_elapsed_since_start": 521.675027}
{"component": "installation_log", "time": "2025-07-07T14:04:48.195550", "logger": "install", "pid": 117923, "level": "ERROR", "file": "/opt/phantom/splunk-soar/./soar-install", "line": 105, "message": "Failed to apply database migrations", "install_run_uuid": "6d87f1da-d62c-47b4-a221-b7520f861df4", "start_time": "2025-07-07T13:56:06.519944", "install_mode": "upgrade", "installed_version": "6.3.1.178", "proposed_version": "6.4.1.361", "deployment_type": "unpriv", "continue_from": null, "time_elapsed_since_start": 521.675709, "pretty_exc_info": ["Traceback (most recent call last):", " File \"/opt/phantom/splunk-soar/./soar-install\", line 82, in main", " deployment.run()", " File \"/opt/phantom/splunk-soar/install/deployments/deployment.py\", line 151, in run", " self.run_deploy()", " File \"/opt/phantom/splunk-soar/usr/python39/lib/python3.9/contextlib.py\", line 79, in inner", " return func(*args, **kwds)", " File \"/opt/phantom/splunk-soar/install/deployments/deployment.py\", line 219, in run_deploy", " operation.run()", " File \"/opt/phantom/splunk-soar/install/operations/deployment_operation.py\", line 131, in run", " self.upgrade()", " File \"/opt/phantom/splunk-soar/install/cluster.py\", line 108, in _impl", " return method(*method_args, **method_kwargs)", " File \"/opt/phantom/splunk-soar/install/operations/tasks/database_schema.py\", line 63, in upgrade", " self.shell.manage_py(\"migrate\", error_msg=\"Failed to apply database migrations\")", " File \"/opt/phantom/splunk-soar/install/console.py\", line 323, in manage_py", " return self.phenv(cmd, **kwargs)", " File \"/opt/phantom/splunk-soar/install/console.py\", line 313, in phenv", " return self.run(f\"{phenv} {cmd}\", **kwargs)", " File \"/opt/phantom/splunk-soar/install/console.py\", line 243, in run", " raise InstallError(", "install.install_common.InstallError: Failed to apply database migrations"]}
2. soar_diag_backport is a diagnostic tool for Splunk SOAR (On-premises). It was necessary for releases 5.3.5 through 6.1.0. Create and download or upload a diagnostic file
3. Since 6.2.0, diag tool is integrated in both UI and command line by default. It is not needed to install diagnostic tool separately.
1. Remove the file settings_local.py in the directory <$PHANTOM_HOME>/www/phantom_ui.
$ cd /opt/phantom/www/phantom_ui/$ cat settings_local.py
from .settings import INSTALLED_APPS
INSTALLED_APPS.append("soar_diag_backport")$ rm settings_local.py
2. Continue upgrading from DatabaseSchema phase
$ cd /opt/phantom/splunk-soar
$ ./soar-install --upgrade --splunk-soar-home /opt/phantom/ -c DatabaseSchema
| Revision | Publish Date | Comments |
|---|---|---|
1.0 |
01-Oct-2026
|
Initial Release |