Product index definitions are delivered using RepositoryInitializer (e.g. AEM and oak itself).
Oak run has tooling to dump index definitions as a json and also ability to create lucene indexes as defined by an index definition json.
That leaves a gap in tooling where we can dump current set of index definitions and prepare an index definition description to prepare of upgrades (thus saving time "during" upgrade). This step is currently done manually and hence is error prone. It'd be nice to have some automated tooling to assist in such a flow.