If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.
New contributors please see our Developer's Guide.
Notes: Jira ticket
Implement a new command for migrating configuration to/from the database.
Example invocations:
mattermost config migrate --config=path/to/config.json --to=”mysql://mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s”
mattermost config migrate --config=”mysql://mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s” --to=path/to/config.json
mattermost config migrate --config=”mysql://mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s” --to=”postgres://mmuser:mostest@dockerhost:5432/mattermost_test?sslmode=disable&connect_timeout=10”
mattermost config migrate --config=path/to/config.json --to=a/different/path/to/configuration.json
This command should instantiate a config store for each DSN using config.NewStore
and then effectively invoke toConfig.Set(fromConfig.Get())
(and toConfig.Save()
). It might be confusing have --config
and --to
flags instead of --from
and --to
(or --config
and --from
). Proposals welcome!
Unit test coverage should verify the effects of the migrate command using another store.
I am interested in this issue but I still have not understood several parts:
toConfig.Set(fromConfig.Get())
(and toConfig.Save()
) only means that copying the config from oldstore to newstore while the config at the oldstore still persists?Also, what do you think if we use the flags --config_source
and --config_destination
? Or perhaps only source and
destination`.
Thank you very much! Have a good day 🙂
@esethna
@lieut-data
May I have a shot on this? 🙂
Sure, go ahead @joshuabezaleel :+1:
@joshuabezaleel,
My concern with the flags is that --config
is a global for the config
subcommand, so it's going to be accepted regardless of what new flags we accept. What if we accept --from
as defining the source configuration, and then alias a --to
to the existing --config
so that we accept either?
Hey @joshuabezaleel,
How is your work on this ticket going? Can we help with something?
Making this one available for the public again due to inactivity. Let me know if you still want to work on this @joshuabezaleel!
Interested in taking a look at this.
@joshuabezaleel - Would that be alright? Did you make some progress on it already?
Thanks for taking care of this @d28park!
Hi @hanzei I am really sorry for my inactivity. There are a couple of things currently going on.
Hope that I can still take issues and won't be a burden in the future.
@d28park Sure! Thank you very much for taking this up! The issue's description should be really helpful.
Most helpful comment
Hi @hanzei I am really sorry for my inactivity. There are a couple of things currently going on.
Hope that I can still take issues and won't be a burden in the future.
@d28park Sure! Thank you very much for taking this up! The issue's description should be really helpful.