The discussion revolves around the need for a Database Cleaner tool in Discourse to remove leftover plugin and theme components from the database without affecting user data or site settings. LotusJeff proposes such a tool to address issues with old plugin data persisting even after restoring backups. merefield suggests setting up a new instance from a backup as the cleanest solution but notes that backups may still include obsolete tables from uninstalled plugins. LotusJeff counters that this still leaves database clutter. merefield explains the technical difficulty due to irreversible migrations and plugin-specific migration files. Jagster questions if there are no tools to move only content like categories and tags. LotusJeff clarifies his use of
This tool would remove any extra configuration data from the database. The tool would remove any added columns, config rows, and tables from the database that are not present in the default installation of Discourse. The tool would leave all the content and sitesettings alone. The primary focus would be to remove all plugin and theme components from the database.
The best solution I can think of is set up a new instance from a backup
That’s the cleanest you will get it whilst keeping your forum data without a lot of manual effort.
However, I believe backups will include all the tables that existed in the instance you backed up from and that may include any created by plugins, even if you have not installed the plugin on the new instance.
If you want to get your hands dirty, you can use the rake tasks to drop a database and create a new one and run migrations all over, but that will delete all your data.
This is why “install a new environment and restore a backup” is not the best solution. You still have leftovers from old components and plugins hanging in the database.
There should be a last-effort tool that strips out any component and plugin changes to the database and leaves the data and site settings alone. This tool could be run before going to the new install solution.