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

[DOC] Clarify compatibility of Saved Objects across versions #63090

Merged
merged 7 commits into from
Mar 8, 2021

Conversation

lucabelluccini
Copy link
Contributor

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.

  • Documentation was added for features that require explanation or tutorials

@timroes timroes requested review from a team and removed request for timroes April 9, 2020 09:00
[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:
Copy link
Contributor

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?

Copy link
Contributor

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"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any update on this?

Copy link
Contributor

@rudolf rudolf May 13, 2020

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Created #66387

@rudolf rudolf self-assigned this May 13, 2020
Copy link
Contributor

@gchaps gchaps left a 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.

@lucabelluccini
Copy link
Contributor Author

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).

@lucabelluccini
Copy link
Contributor Author

So in these two topics?

https://www.elastic.co/guide/en/kibana/current/saved-objects-api-export.html
https://www.elastic.co/guide/en/kibana/current/saved-objects-api-import.html

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.

@rudolf rudolf added Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels May 15, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@gchaps
Copy link
Contributor

gchaps commented May 15, 2020

@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.

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-docs (Team:Docs)

@ppf2
Copy link
Member

ppf2 commented Oct 1, 2020

Bump. Still a recurring question from the field. Would like to see this officially documented :)

@lucabelluccini
Copy link
Contributor Author

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 .kibana or export via Kibana UI or via Kibana APIs).

@lucabelluccini
Copy link
Contributor Author

lucabelluccini commented Dec 2, 2020

Hello @rudolf
It is great since #82406 we'll surface the fact we're trying to import a NEW saved object into an OLD Kibana instance.
But I still think it is nice to document importing saved objects from version N to N-1 is not possible especially because users will not see the actual error message ...which belongs to a more recent version of Kibana (... until #82406 is out.


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.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
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.

@lucabelluccini lucabelluccini marked this pull request as ready for review March 1, 2021 11:01
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

Copy link
Contributor

@gchaps gchaps left a 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:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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:

Copy link
Contributor

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.

@rudolf rudolf merged commit 4c58e70 into master Mar 8, 2021
rudolf added a commit that referenced this pull request Mar 9, 2021
rudolf added a commit that referenced this pull request Mar 9, 2021
@rudolf rudolf deleted the docs-kibana-so-import-export-compat branch March 9, 2021 15:53
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 63090 or prevent reminders by adding the backport:skip label.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 10, 2021
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 63090 or prevent reminders by adding the backport:skip label.

1 similar comment
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 63090 or prevent reminders by adding the backport:skip label.

@rudolf rudolf added the backport:skip This commit does not require backporting label Mar 15, 2021
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 15, 2021
@jportner
Copy link
Contributor

jportner commented Jun 29, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages Feature:Saved Objects release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Docs v7.0.3 v7.1.3 v7.2.3 v7.3.3 v7.4.3 v7.5.2 v7.6.3 v7.7.2 v7.8.2 v7.9.4 v7.10.3 v7.11.2 v7.12.1 v7.13.0 v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants