This example demonstrates usage of scriptella-mongodb-driver for migration between an H2 relational database and MongoDB.
- Execute
create-h2.shto create a relational database in H2. The database has 3 tables:Users,PostsandCommentsdefined inschema.sql. The database is initialized using test data fromdata.sql. - Execute
h2-to-mongo.shto migrate the database to MongoDB. As a result, two collections should be created: users and posts. Thepostscollection also includes matching comments from theCOMMENTStable. - Execute
mongo-to-h2.shto migrate data from MongoDB to the database.