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

Add es:migrate command #81

Merged
merged 3 commits into from
Nov 13, 2020
Merged

Add es:migrate command #81

merged 3 commits into from
Nov 13, 2020

Conversation

alexandrebouthinon
Copy link
Member

What does this PR do?

Add a new command to the es module to migrate data and mappings from an Elasticsearch server to another using bulk API:

kourou

Copy link
Contributor

@Aschen Aschen left a comment

Choose a reason for hiding this comment

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

Good job 🎉

Also can you provide examples of the command with the public static examples = [] please?

static flags = {
help: flags.help(),
src: flags.string({
description: 'Source Elasticsearch server URL (',
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
description: 'Source Elasticsearch server URL (',
description: 'Source Elasticsearch server URL',

default: false,
}),
limit: flags.integer({
description: 'Document transfer limit',
Copy link
Contributor

Choose a reason for hiding this comment

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

The description in unclear to me, what kind of limit are we talking about?

description: 'Document transfer limit',
default: 1000,
}),
force: flags.boolean({
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpicking: maybe --no-interactive like APT is more understandable?

private async migrateData(index: string, limit: number) {
const queue = []
// Quick scroll duration estimation based on number of documents per hit
const scrollDuration = 5 * (limit % 1000) > 0 ? `${5 * (limit % 1000)}s` : '5s'
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand the purpose of this line since the value of scrollDuration wont grow linearly with the value of limit.
On the opposite, a small limit like 103 will give me 515s of scrollDuration

@scottinet scottinet merged commit 92ae608 into develop Nov 13, 2020
@scottinet scottinet deleted the es-migrate branch November 13, 2020 08:59
@Aschen Aschen mentioned this pull request Feb 8, 2021
Aschen added a commit that referenced this pull request Feb 8, 2021
# [0.18.0](https://github.com/kuzzleio/kourou/releases/tag/0.18.0) (2021-02-08)


#### New features

- [ [#82](#82) ] Add an option to export data in a format compatible with Kuzzle fixtures   ([jenow](https://github.com/jenow))
- [ [#81](#81) ] Add es:migrate command   ([alexandrebouthinon](https://github.com/alexandrebouthinon))

#### Enhancements

- [ [#93](#93) ] Update app template   ([Aschen](https://github.com/Aschen))
- [ [#92](#92) ] Add yaml support for vault   ([Aschen](https://github.com/Aschen))

#### Others

- [ [#77](#77) ] Add Quine example   ([Aschen](https://github.com/Aschen))
---
@Aschen Aschen mentioned this pull request Feb 25, 2021
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.

3 participants