diff --git a/CHANGELOG.md b/CHANGELOG.md
index 75ad263..4ddbed2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
- fix(config): store the app store category cache lazily with only the names in the languages in use, refresh it weekly and when the settings are saved, and load it only when categories are used
- fix(admin): save all settings in one request so changes are not lost after the page reloads
+- fix(config): remove the old category cache from the app config on upgrade
## 6.2.0
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 5ebaa54..91b95f4 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -55,6 +55,11 @@ In case of downtime, you can download **Custom Menu** from [here](https://kim.de
+
+
+ OCA\SideMenu\Migration\ClearCategoryCache
+
+
OCA\SideMenu\Settings\Admin
OCA\SideMenu\Settings\AdminSection
diff --git a/lib/Migration/ClearCategoryCache.php b/lib/Migration/ClearCategoryCache.php
new file mode 100644
index 0000000..df54327
--- /dev/null
+++ b/lib/Migration/ClearCategoryCache.php
@@ -0,0 +1,46 @@
+.
+ */
+
+namespace OCA\SideMenu\Migration;
+
+use OCA\SideMenu\Service\CategoryRepository;
+use OCP\Migration\IOutput;
+use OCP\Migration\IRepairStep;
+
+/**
+ * Earlier versions stored the category cache as a regular app config
+ * value, which Nextcloud loads on every request. Clear it on upgrade so
+ * it does not linger on instances that never request the categories.
+ */
+class ClearCategoryCache implements IRepairStep
+{
+ public function __construct(protected CategoryRepository $categoryRepository)
+ {
+ }
+
+ public function getName(): string
+ {
+ return 'Clear the category cache';
+ }
+
+ public function run(IOutput $output): void
+ {
+ $this->categoryRepository->clearCache();
+ }
+}