Upgrade using the Python 2 runtime and make minimal changes to Python code
Use this upgrade path if you want to continue using the Python 2 runtime as much as possible. To see the other upgrade path option and choose the upgrade path that is best for you, see Choose your Splunk Enterprise upgrade path for the Python 3 migration.
This upgrade path has three parts:
Resolve upgrade blockers
In preparation to migrate to Python 3 during your upgrade to version 8.0 or higher, take the following steps. Using a test environment is optional. If you don't use a test environment, this process might impact performance. See Performance considerations in the Splunk Platform Upgrade Readiness App manual for more information.
Prepare for upgrade with the Splunk Platform Readiness app
- (Optional) In a test environment, install all your production apps and replicate any custom scripts you've included in your production environment outside of an app context.
- Install the Splunk Platform Upgrade Readiness App and run it, preferably on your test instance. See About the Splunk Platform Upgrade Readiness App in the Splunk Platform Upgrade Readiness App manual for more information.
- Review the test results for your private apps and follow the instructions in the Upgrade Readiness App for any items marked BLOCKER to resolve the issue.
- Review the test results for the apps you downloaded from Splunkbase and check for file paths that contain content that you customized or extended. Address any issues before continuing.
Manually prepare for upgrade
If you choose not to use the Upgrade Readiness App, manually check your Splunk Enterprise deployment for issues. Confirm you've met these upgrade readiness requirements in your private apps and extensions before you continue:
- Remove all Advanced XML.
- If you are running SplunkWeb Legacy Mode, disable it by editing
%SPLUNK_HOME%\etc\system\local\web.confto remove the
- Adjust custom Mako templates to be compatible with both Python 2 and Python 3.
- Adjust custom CherryPy endpoints in apps to be compatible with Python 2 and Python 3.
For more information about these upgrade requirements, see Python 3 migration with the Splunk platform in the Python 3 Migration manual.
- In the
python.versionsetting of your server.conf file, ensure the version is
Upgrade Splunkbase apps and validate
Only after you have completed all the preparation steps, upgrade to Splunk Enterprise 8.0 or higher in a test environment, following the three-phase Splunk Enterprise upgrade process. For more information, see Splunk Enterprise upgrade process.
To reduce performance impact, upgrade to Splunk Enterprise 8.0 or higher in a test environment first to test for breaking changes. Don't upgrade in your production environment directly.
Follow these steps to validate your upgrade in your test environment:
- Test your Splunk Web-dependent Python by accessing all views that rely on custom CherryPy endpoints or Mako templates and ensuring that they function as expected.
- Upgrade your installed Splunkbase apps to versions that support Splunk Enterprise 8.0 or higher and test for any breaking changes. If the developer hasn't provided a version of the app that is compatible with Splunk Enterprise 8.0 or higher, update it yourself to meet the requirements, or remove the app.
Upgrade Splunk Enterprise
Upgrade your production environment to version 8.0 or higher on your search heads, indexers, and forwarders, following the three-phase Splunk Enterprise upgrade process. For more information, see Splunk Enterprise upgrade process. As you upgrade the components of your deployment, follow this order of operations:
- In the
[python.version]stanza of your server.conf file, ensure the version is
- Upgrade to Splunk Enterprise 8.0 or higher.
- Note any potential breaking changes, such as apps that aren't compatible yet with Splunk Enterprise 8.0 or higher at time of upgrade.
- Install any apps that are only compatible with Python 3 and Splunk Enterprise 8.0 or higher.
- Start Splunk Enterprise.
Completing this process does not mean you have finished upgrading to Python 3. Plan to finish upgrading to Python 3 in the future.
Upgrade using the Python 3 runtime and dual-compatible Python syntax in custom scripts
Uninstall Splunk Enterprise
This documentation applies to the following versions of Splunk® Enterprise: 8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.5, 8.0.6, 8.0.7, 8.0.8, 8.0.9, 8.0.10, 8.1.0, 8.1.1, 8.1.2, 8.1.3, 8.1.4, 8.1.5, 8.1.6, 8.1.7, 8.1.8, 8.1.9, 8.1.10, 8.2.0, 8.2.1, 8.2.2, 8.2.3, 8.2.4, 8.2.5, 8.2.6