-
Notifications
You must be signed in to change notification settings - Fork 33
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
Multi-proxy data migration #1436
Comments
Did we agree on providing a data migration? The other option was to document breaking changes and provide a data migration path AFTER we implemented multi-proxy. |
We need to really see the trade-off for data migrations for the latest refactor. If it takes less time to recreate the data somehow (or even do some data migrations straight in the DB), then I would suggest to do just that. But after this release on we should provide data migrations... |
@philippeluickx well, that would be relief, and save me from some headache, if documenting the breaking changes would be just enough, and we would provide migration path AFTER these big changes. I could bring this up in daily, what others think. |
Yes, please discuss in daily. Also +1 in documenting the breaking changes and maybe also state somewhere clearly that as of (current version) data migrations will always be provided. |
@philippeluickx We decided that I investigate first database/schema changes between 0.2.28 -> current develop & give some estimation of the work. We might not need to provide migration path for custom Apika fork, so that makes it a bit more possible to handle this. |
@philippeluickx I read about scripting Mongo yesterday & last evening, maybe we could do this bigger change also that way https://blog.kevinchisholm.com/javascript/mongodb/getting-started-with-mongo-shell-scripting-basic-crud-operations/ Maybe that is what you were going to suggest? |
Preferably, the JS code would run automatically when Meteor starts. That way, administrators don't have any manual steps required when upgrading, other than deploying the latest version. That is the strategy percolate:migrations offers -- we automatically run our migration code to the latest version when starting the app. |
@shaliko is there a way to hook in to the Docker deployment lifecycle to automatically execute some script(s) in MongoDB shell? |
@jykae after reviewing that article, I notice the code looks very similar to what we would write if we used mongodb-migrations. However, using mongodb-migrations gives us a higher level API that is specifically related to migrating database structure, as opposed to hacking together migration scripts. What do you think would be difficult about using the native MongoDB wrapper in Apinf (which would let us use mongodb-migrations package)? |
@brylie Well, it's not that much higher-level imho, it uses official native MongoDB API. Main difference is would we like to do it as migration or not ie. keep track of run scripts & DB version. I could take a look at mongodb-migrations way of doing this, and call migrations to run on startup, if that's the way wanted. I had some problems with configuring & running that mongodb-migrations previously, when I tried it. Error messages were not that clear what I did wrong. Might have been beginner problems, some small mistake, that's why I proposed percole:migrations back then for simpler usage. I have written down field mappings as a text file for reference yesterday. |
Yes, the database code is almost the same. The migration related API would provide a “via ferrata” to safely move from version to version, rather than solo climbing the data migration rock face. Lets pair program to try out either or both of the migration frameworks under discussion. Related |
@brylie Nice article. |
Got mongodb-migrations conf working, and simple run up working with CLI. Starting next week writing up the migration steps. There are open issues with rollback though, so backups before upgrading to next release might be good idea @shaliko |
I have migration script halfway done with mongodb-migrations. However handling database operations with async.series makes migration script bit more harder to read. percolate:migrations would be nicer for developer to write migrations. @brylie @philippeluickx Do we want pure node.js migration code to our codebase? |
I am always up for the most simple and elegant solution. |
Also meteor mongo driver wrapper hides the real Mongo ObjectID
Native driver that mongodb-migrations uses is not doing that. |
@philippeluickx ok, I will make tomorrow percolate:migrations solution for the task, and can show also this halfway written migration code if we need to vote. |
Sorry I forgot to keep async version with mongodb-migrations for comparison, as I moved the code and refactored to Meteor sync model with percolate:migrations. I think percolate:migrations is easier to read, and goes better with our codebase. Also easier for every developer to write couple of fields migration for PR. Anyway async.series migration code looked like this, https://github.com/awapps/mongration#multiple-queries-example |
Meteor DB backup/restore: http://stackoverflow.com/questions/16816860/meteor-how-can-i-backup-my-mongo-database
Official MongoDB driver API (Node.js): http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html
Mongration: https://github.com/awapps/mongration
The text was updated successfully, but these errors were encountered: