Reindexing outside of the cluster
To minimize downtime for your users, you’ll use a copy of your database to create the index outside of the production cluster. With most of the data already indexed, your upgraded nodes will only add the missing changes instead of creating the whole index from scratch.
Overview
Before you begin
You can complete these steps without shutting down your Jira Data Center.
Creating the index outside of the cluster
You’ll make a copy of your database and connect Jira 8.5 to it. This will allow you to create an index that is compatible with Jira 8 outside of your production cluster.
1. Copying the NodeIndexCounter
table
Make a copy of the
NodeIndexCounter
table from your database.
Why do I need this?
The NodeIndexCounter
table records the changes that were applied by individual nodes to their copies of the index. By copying it now, and restoring it later to your original database (during the upgrade), you’ll make sure that the upgraded nodes include all possible changes made by your users from this point on.
2. Copying the database
Make a copy of your live database. Don’t worry about users adding new data, because you’ll switch back to the original database later on.
These steps should be completed as close to the actual upgrade as possible so the difference between the original and cloned database is not too big, and doesn’t exceed the retention period.
3. Connecting the database copy to Jira 8.5
You’ll need a separate Jira 8.5 environment that you’ll connect your database copy to. Here are requirements for this environment:
Must be Jira 8.5.
Must have the same plugins as your production instance (plugins can provide data coming from custom fields, and add data to the index during reindexing).
Must have a Data Center license, but you can use a single node.
The easiest way to set up this environment is to complete these steps:
By following these steps, you will install a separate 8.5 instance, disable automatic reindex, giving yourself time to install the plugins (or copy them from your production environment), and then perform a manual reindex whenever you’re ready.
Follow Upgrade Jira on the first node from Upgrading Jira Data Center. When configuring Jira 8.5, make sure to connect it to the copy of your database that you created in the previous steps.
Follow Post-upgrade steps on the first node from Upgrading Jira Data Center.
Result
After completing the manual reindex, you should have a Jira 8 index that’s based on the information from the copy of your database. It’s still missing all the information that was added to the original database since you’ve made the copy, but it will be easier for your nodes to add missing entries for these changes than create the whole index from scratch.
Copying the index to your nodes
The Jira 8 index is stored in a different directory than the old one, so it won’t affect your existing cluster. You can already copy the new index to each of the nodes, so they don’t have to download it.
Copy the Jira 8 index to the following directory on each node:
<local-home-directory>/caches/indexesV1
Upgrading Jira Data Center
This is where you’ll need to shut down your Jira Data Center and start the upgrade.
Upgrading the first node
We recommend that you upgrade Jira Data Center by choosing a single node, upgrading it, and then copying the installation directory to other nodes, just to save time. You can choose any node here.
Stop the cluster.
Restore the
NodeIndexCounter
table, which you copied at the beginning of this procedure, to your original database. This will make sure that the nodes create entries for all the information added to your original database since you’ve started the upgrade.Upgrade the first node. Follow Upgrade Jira on the first node from Upgrading Jira Data Center. Before you start, make sure to read the note below.
Disabling automatic reindex
The last step of the linked procedure will tell you to disable automatic reindex (Step 5: Disabling automatic reindex). Make sure to complete it, as otherwise Jira will initiate automatic reindex, something you’re trying to avoid.
Complete post-upgrade steps on the first node. Follow Post-upgrade steps on the first node from Upgrading Jira Data Center.
One of the steps will tell you to rebuild index. Make sure to omit this step, as you have already created the index outside of the cluster, so there’s no need to create it again.
What happens here?
After you start the first node, the database will be upgraded. As the next step, the node would check the state of the index, and reindex if needed. But, since you’ve already copied a compatible index, the node will detect it and only add entries for the missing changes — the difference between you original and cloned database that you used to create the Jira 8 index. From the node’s perspective, it looks like it was offline for a short while.
Optional: Requesting a snapshot of the index
This optional step can make your nodes download a snapshot of the index from the first node instead of replaying the updates from the database.
Upgrading remaining nodes
You can now copy the installation directory to remaining nodes to upgrade them.
Upgrade remaining nodes. Follow Upgrade remaining nodes from Upgrading Jira Data Center.
Reindexing again
Your nodes should already have a complete index, but we recommend that you reindex again, just to be sure that not a single change has been omitted. You don’t have to shut down your Jira Data Center, as reindexing will be performed on a single node.
Go to > System > Indexing (you can search for it by pressing '.')
Choose Full reindex.
This reindexing will take more time to complete, but it doesn’t block your users from using Jira. Once it’s complete, the new index will be automatically distributed to the remaining nodes.