Home > OS >  Upgrading springboot version from 2.2.13 to 2.3.0.RELEASE version
Upgrading springboot version from 2.2.13 to 2.3.0.RELEASE version

Time:04-06

Inorder to upgrade to 2.3.0.RELEASE and more I have problem with mongobee. so i am thinking of migrating to mongock which works well with 2.5 version springboot. Now i need to replace everything of mongobee to mongock

@Bean
    public Mongobee Mongobee() {
        Mongobee runner = new Mongobee("mongodb://"   mongodbHost   ":"   mongodbPort   "/"   mongodbName);
        runner.setDbName(mongodbName);
        runner.setChangeLogsScanPackage("  ");

        return runner;
    }

This above line of code i need to change to mongock i am need some suggestion

I have added the dependencies required for mongock and also there werelot of deprecated mongodb classes which i have solved. now i am stuck with this.

CodePudding user response:

This covers two parts:

  1. Create the Mongock bean
  2. Tell Mongock you are migrating from Mongock
  • Creating the Mongock bean

Although you can, you don't need to create the bean yourself, Mongock does it for you. Please take a look to the Mongock's documentation, specifically in step 7, Build the runner. As you can see, you just need to provide the scanPackage in the properties and annotate your Spring boot class with @EnableMongock

  • Telling Mongock you are migrating from Mongock

With this step you are telling Mongock that you have some migrations executed with another framework, in this case Mongobee. You need to tell the old changeLog collection and some other configuration parameters. Everything you need for this step, you can find it here. As you can see, at the bottom of the page, you have some references to Mongobee

  • Related