How to manage Jira Data Center license using database queries
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Please note that this article is only about updating the license key of Jira applications (Jira Core, Jira Software, Jira Service Management) in the database.
If you are trying to update the license key of 3rd party add-ons installed in the Jira application, please refer to the following article instead: How to update the license key of a third party add-on directly in the Jira Database
Summary
If for whatever reason the JIRA license key needs to be extracted from the database, it can be done with the following SQL:
SELECT * FROM productlicense;
This is tested on PostgreSQL and may need modifying for other DBMS such as Oracle or SQL Server. Please consult with your DBA for any syntax corrections which may need to be made.
For JIRA 7.0.4 and below:
SELECT propertyvalue AS license
FROM propertytext pt
JOIN propertyentry pe
ON pt.id = pe.id
WHERE property_key = 'License20';
Note that there is no license to product (ie. Core, Software, Service Management) relation mapping stored in the DB. Jira just stores the license as is and will decode it to apply to respective product
Solution
Updating the License
It is possible to update the license directly in the database however it is not recommended. This is because it can cause data integrity problems and may lead to data corruption. If you choose to do this please keep in mind we may be unable to provide support.
Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.
- Stop JIRA.
Execute the following to locate the ID to modify:
JIRA 7.0.5 and above
SELECT * FROM productlicense;
JIRA 7.0.4 and below
SELECT pt.id FROM propertytext pt JOIN propertyentry pe ON pt.id = pe.id WHERE property_key = 'License20';
Update the license with the following:
JIRA 7.0.5 and above
UPDATE productlicense SET license ='<license_string>' WHERE id= <id_from_step_2>;
JIRA 7.0.4 and below
UPDATE propertytext SET propertyvalue = '<license_string>' WHERE id = <id_from_step_2>;
- Start JIRA.