Here we will walk through the steps to send data from a relational database to MongoDB using SymmetricDS. Since SymmetricDS is trigger based and there are not triggers in MongoDB data can only synchronized to a MongoDB instance.

Lets begin the MongoDB synchronization ...

  1. Install MongoDB and run.
  2. Install SymmetricDS Pro and run.
  3. Create a new master node through the SymmetricDS Pro web console and connect it to your source relational database of choice. In this example I used Microsoft SQL Server.
  4. Create a second node. A second node is required to attach to a relational database to store SymmetricDS system tables.

  5. I choose to create a local node since this is just a lightweight database to hold SymmetricDS configuration only.
  6. When selecting your relational database for the second node I would recommend H2.
  7. Once the second node has registered (verified on Managed -> Nodes screen), stop SymmetricDS.
  8. Locate your engine properties file on your file system. There should be two files one for your master and one for the H2 node.

    Add the following properties for your H2 node and adjust as needed. I do not have user/pass for my MongoDB so these are commented out.
    #mongodb.username=xxxx #mongodb.password=xxxx mongodb.port=27017 mongodb.default.databasename=mongoBlog
  9. Startup SymmetricDS
  10. Create a new channel with the mongodb data loader selected.
  11. Setup triggers and link routers to use the new channel
  12. Insert data into the source table
  13. Verify the data made it to your MongoDB
  14. Congratulations your MongoDB synchronization is ready!
Josh Hicks
Author: Josh Hicks

Josh has worked in the IT industry for over 15 years as a developer, tech lead, and architect. He has worked across a variety of businesses including retail, telecommunications, education, and healthcare. When he is not developing he enjoys whatever sporting event might be taking place.