Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial upgrade process support #4954

Merged
merged 6 commits into from
Aug 9, 2024

Conversation

carlesarnal
Copy link
Member

This introduces the initial support for migrating from Registry V2 to V3. The current implementation is intended to work as follows:

  • The user exports all the data from Registry v2 using the existing export feature.
  • In a fresh installation of Registry V3, using the property apicurio.upgrade.file.location the user can specify the location of a V2 export file that will be processed and imported into the server.

final URL registryV2ExportUrl = regisrtryV2ExportFile.get();
try (final InputStream registryV2ExportZip = new BufferedInputStream(
registryV2ExportUrl.openStream())) {
log.info("Importing {} on startup.", registryV2ExportUrl);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible to detect that the ZIP file really is a v2 export? Perhaps by examining the manifest info?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can detect it here, but even if I don't it will fail down the path if it's not since all the entities will be parsed to v2 versions, so if it's not a V2 export zip it will fail to import the data. That said, it's probably better to fail fast here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's what I was thinking: fail fast. Of course that assumes the manifest file is the first entry. Which it is if the ZIP was created by Registry.

Copy link
Member

@EricWittmann EricWittmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good! Just a couple minor comments.

@carlesarnal carlesarnal force-pushed the upgrade-process branch 2 times, most recently from f782dbc to ce59d31 Compare August 7, 2024 07:54
@carlesarnal carlesarnal marked this pull request as ready for review August 8, 2024 18:28
@EricWittmann EricWittmann merged commit 2b64e59 into Apicurio:main Aug 9, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants