Possible to manually move ES index to new host?

Must-share information (formatted with Markdown):

  • 9.9 LTA (enterprise, but that’s not a category option here)
  • Deployed via Docker on bare metal, data directories are bind-mounted to the host filesystem
  • looking to achieve a faster process to move an existing service to a new host
  • letting Sonar build a fresh index on the new host works, but takes quite a while (yes, we have many thousands of projects).

Is there any reason why I can’t (or shouldn’t) simply copy the es7 directory from the old host (after app shutdown) to the new one (before app startup)? The same DB would be used by both.

Thanks!

Hey @dreness

In theory, it should work. However, historically, Elasticsearch indices have been pretty fragile when moving between servers. Since the only troubleshooting step we offer is to force a full reindex, we recommend that most users do this from the start.

For what it’s worth, we put a lot of work into the v10.x series of SonarQube to minimize the impact of reindexing on users. Starting from SonarQube v10.2, SonarQube only indexes what is absolutely necessary to start and then progressively becomes available as indexing completes (however, analysis of all projects is immediately available). You can read more about that here.

This will also be included in SonarQube’s next (very soon to be announced) LTA release.

Hey Colin,

Thanks for the reply, and glad to hear about the recent optimizations for indexing to avoid blocking startup. Also great to hear that a new LTA is on deck!

Cheers,
-dre