-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[DOC] Clarify compatibility of Saved Objects across versions #63090
Conversation
[float] | ||
==== Compatibility across versions and downgrades | ||
|
||
We do not guarantee compatibility of a Saved Object exported from newer Kibana version and imported to older Kibana version: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rudolf I thought importing objects with a higher migrationVersion
to an older instance would just throw an error for the object, but I can't find this behavior in src/core/server/saved_objects/import/import_saved_objects.ts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on this forum post https://discuss.elastic.co/t/copy-visualisation-and-dashboards/225958 I don't think it's producing a nice error message, just failing with a generic "Could not be processed"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any update on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before creating any objects we migrate them, so trying to import a newer object will fail the migration and therefore the SavedObjectsRepository#bulkCreate
.
The API correctly responds with:
{"statusCode":422,"error":"Unprocessable Entity","message":"Document \"d3d7af60-4c81-11e8-b3d7-01146121b73d\" has property \"index-pattern\" which belongs to a more recent version of Kibana [8.1.0]. The last known version is [7.6.0]"
But like @flash1293 said we don't display this to users, I'll open an issue for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When importing using the deprecated .json
file format we correctly surface the error in the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #66387
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Kibana docs include this topic under Upgrade: Troubleshooting saved object migrations. This page includes information about the automatic upgrade.
So I think maybe we can include something like this on that page:
NOTE: A saved object exported from Kibana is only guaranteed to work when imported in the same, or more recent version, of Kibana. To work with saved objects in a previous version of Kibana, restore the snapshot of the Kibana indices taken prior to the upgrade.
If they followed the instructions on the upgrade page, they should have taken a snapshot prior to upgrading.
I would mention the compatibility thing also in the import/export APIs as a user might be interested in copying an object from one instance to another and they might be in different versions (new to old and old to new). |
Yes, this would be great - Or maybe on https://www.elastic.co/guide/en/kibana/current/saved-objects-api.html where we can explain what a Saved Object is and the compatibility. I'm sharing some thoughts but not 100% sure where they should be placed. |
Pinging @elastic/kibana-platform (Team:Platform) |
@lucabelluccini This topic has a brief explanation of what a saved object is. Let me know if you think that explanation should be improved as well. |
Pinging @elastic/kibana-docs (Team:Docs) |
Bump. Still a recurring question from the field. Would like to see this officially documented :) |
As @ppf2 suggests, we need a clear statement of the compatibility of Saved Objects across versions and list the supported "backup" options for Kibana Saved Objects (snapshot of |
Hello @rudolf |
|
||
Kibana automatically performs a Saved Object migration at every upgrade (even minor versions) due to format changes, new features or fixes. | ||
|
||
The official process to perform a Kibana downgrade is to restore a snapshot of the Kibana indices taken before the upgrade. Please **always** snapshot all the Kibana indices prior upgrading. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The official process to perform a Kibana downgrade is to restore a snapshot of the Kibana indices taken before the upgrade. Please **always** snapshot all the Kibana indices prior upgrading. |
Pinging @elastic/kibana-core (Team:Core) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -6,6 +6,18 @@ | |||
|
|||
experimental[] Create sets of {kib} saved objects from a file created by the export API. | |||
|
|||
==== Compatibility across versions | |||
Saved objects can only be imported into the same version, a newer minor on the same major or the next major. Exported saved objects are not backwards compatible and cannot be imported into an older version of {kib}. See the table below for compatibility examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saved objects can only be imported into the same version, a newer minor on the same major or the next major. Exported saved objects are not backwards compatible and cannot be imported into an older version of {kib}. See the table below for compatibility examples: | |
Saved objects can only be imported into the same version, a newer minor on the same major, or the next major. Exported saved objects are not backwards compatible and cannot be imported into an older version of {kib}. See the table below for compatibility examples: |
|
||
With each release, {kib} introduces changes to the way saved objects are stored. When importing a saved object, {kib} will run the necessary migrations to ensure that the imported saved objects are compatible with the current version. | ||
|
||
However, saved objects can only be imported into the same version, a newer minor on the same major or the next major. Exported saved objects are not backwards compatible and cannot be imported into an older version of {kib}. See the table below for compatibility examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, saved objects can only be imported into the same version, a newer minor on the same major or the next major. Exported saved objects are not backwards compatible and cannot be imported into an older version of {kib}. See the table below for compatibility examples: | |
However, saved objects can only be imported into the same version, a newer minor on the same major, or the next major. Exported saved objects are not backwards compatible and cannot be imported into an older version of {kib}. See the table below for compatibility examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure the comma is correct.
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Friendly reminder: Looks like this PR hasn’t been backported yet. |
This was mistakenly never backported to 7.x, before the 7.13 branch was cut. So I'm now backporting it to 7.13 and 7.x. Edit: I see this was reverted in favor of #94072, I'll backport that instead. |
Summary
Clarify compatibility of Saved Objects across versions and best practices for Kibana downgrades.
It might be moved to "Limitations" sections, eventually.
Checklist
Delete any items that are not applicable to this PR.