Hi Antonio, and I hope I am reading this right, when you talk about a new installation of v2.91, do you mean that you have created an entirely new Moodle? Totally vanilla? On a brand new server? Seriously suggest if you are changing servers, then just clone the whole Moodle to the new server, then upgrade the code to v2.91. (If your older Moodle is still intact, this is simple, migrate and change the settings in the config.php file.) Add in your course updates from there. If replacing courses, archive the older courses by changing their names and short names move them to a new folder inside the Moodle, then add in the replacements.
If you have created a new Moodle rather than upgrade your existing Moodle, then you have really done it the hard way. Moodle will always duplicate stuff and append where it is unclear what needs be done, it is just not that sophisticated yet - it will be, but not yet. In these situations, just update the core code, that does not have any effect on the courses or other materials in the Moodle database. It is a lot simpler and easier to not have to do anything to your courses except normal updates. There are three major elements of Moodle, the core code, the database and the course materials, of which, the core code is the easiest to change. To prevent duplication in these circumstances is a lot easier.
Also suggest you have two Moodles, one to test things on first, before you make any changes to your production site. Set the name of the cookie prefix in Site Admin > Server > Session Handling to two different names, and you can run the Moodles side by side. with different IP addresses, or you can put them on different servers. This has saved me so much grief over the years.