diff --git a/apps/user_ldap/appinfo/info.xml b/apps/user_ldap/appinfo/info.xml
index 61197e2fd12f877b72cbb791b47c48decfd1ba6f..b618d2a203dd522d71d06b09e174e89a8d8f4de0 100644
--- a/apps/user_ldap/appinfo/info.xml
+++ b/apps/user_ldap/appinfo/info.xml
@@ -34,6 +34,9 @@ A user logs into Nextcloud with their LDAP or AD credentials, and is granted acc
 	</background-jobs>
 
 	<repair-steps>
+		<install>
+			<step>OCA\User_LDAP\Migration\SetDefaultProvider</step>
+		</install>
 		<post-migration>
 			<step>OCA\User_LDAP\Migration\UUIDFixInsert</step>
 			<step>OCA\User_LDAP\Migration\RemoveRefreshTime</step>
diff --git a/apps/user_ldap/appinfo/install.php b/apps/user_ldap/appinfo/install.php
deleted file mode 100644
index 731630000defed852e2e60bbf3e529efa931295e..0000000000000000000000000000000000000000
--- a/apps/user_ldap/appinfo/install.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- * @author root <root@localhost.localdomain>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-$config = \OC::$server->getConfig();
-$state = $config->getSystemValue('ldapIgnoreNamingRules', 'doSet');
-if ($state === 'doSet') {
-	\OC::$server->getConfig()->setSystemValue('ldapIgnoreNamingRules', false);
-}
-
-$helper = new \OCA\User_LDAP\Helper($config, \OC::$server->getDatabaseConnection());
-$helper->setLDAPProvider();
diff --git a/apps/user_ldap/composer/composer/autoload_classmap.php b/apps/user_ldap/composer/composer/autoload_classmap.php
index 465c577f86983833eb04ba9b8338a10f7752e6c9..a8f705094a5cc9e09014ffeb6b82df549f06a511 100644
--- a/apps/user_ldap/composer/composer/autoload_classmap.php
+++ b/apps/user_ldap/composer/composer/autoload_classmap.php
@@ -51,6 +51,7 @@ return array(
     'OCA\\User_LDAP\\Mapping\\GroupMapping' => $baseDir . '/../lib/Mapping/GroupMapping.php',
     'OCA\\User_LDAP\\Mapping\\UserMapping' => $baseDir . '/../lib/Mapping/UserMapping.php',
     'OCA\\User_LDAP\\Migration\\RemoveRefreshTime' => $baseDir . '/../lib/Migration/RemoveRefreshTime.php',
+    'OCA\\User_LDAP\\Migration\\SetDefaultProvider' => $baseDir . '/../lib/Migration/SetDefaultProvider.php',
     'OCA\\User_LDAP\\Migration\\UUIDFix' => $baseDir . '/../lib/Migration/UUIDFix.php',
     'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => $baseDir . '/../lib/Migration/UUIDFixGroup.php',
     'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => $baseDir . '/../lib/Migration/UUIDFixInsert.php',
diff --git a/apps/user_ldap/composer/composer/autoload_static.php b/apps/user_ldap/composer/composer/autoload_static.php
index 4760607713c384e35c66bd4508a8fc03f53c8c53..53e0646233b652664efbd94729bcb60ae401ff71 100644
--- a/apps/user_ldap/composer/composer/autoload_static.php
+++ b/apps/user_ldap/composer/composer/autoload_static.php
@@ -66,6 +66,7 @@ class ComposerStaticInitUser_LDAP
         'OCA\\User_LDAP\\Mapping\\GroupMapping' => __DIR__ . '/..' . '/../lib/Mapping/GroupMapping.php',
         'OCA\\User_LDAP\\Mapping\\UserMapping' => __DIR__ . '/..' . '/../lib/Mapping/UserMapping.php',
         'OCA\\User_LDAP\\Migration\\RemoveRefreshTime' => __DIR__ . '/..' . '/../lib/Migration/RemoveRefreshTime.php',
+        'OCA\\User_LDAP\\Migration\\SetDefaultProvider' => __DIR__ . '/..' . '/../lib/Migration/SetDefaultProvider.php',
         'OCA\\User_LDAP\\Migration\\UUIDFix' => __DIR__ . '/..' . '/../lib/Migration/UUIDFix.php',
         'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixGroup.php',
         'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixInsert.php',
diff --git a/apps/user_ldap/lib/Helper.php b/apps/user_ldap/lib/Helper.php
index dce67a76c41a4b0aba54fe0bf4e6f4eafa53b9aa..67d31516f44a4a76c4c6e7951adf6002cffb1eb1 100644
--- a/apps/user_ldap/lib/Helper.php
+++ b/apps/user_ldap/lib/Helper.php
@@ -213,18 +213,6 @@ class Helper {
 		return $domain;
 	}
 
-	/**
-	 *
-	 * Set the LDAPProvider in the config
-	 *
-	 */
-	public function setLDAPProvider() {
-		$current = \OC::$server->getConfig()->getSystemValue('ldapProviderFactory', null);
-		if (is_null($current)) {
-			\OC::$server->getConfig()->setSystemValue('ldapProviderFactory', LDAPProviderFactory::class);
-		}
-	}
-
 	/**
 	 * sanitizes a DN received from the LDAP server
 	 *
diff --git a/apps/user_ldap/lib/Migration/SetDefaultProvider.php b/apps/user_ldap/lib/Migration/SetDefaultProvider.php
new file mode 100644
index 0000000000000000000000000000000000000000..21998d847b9d27ee7c8b5f63d38ad0d4b3e85c5f
--- /dev/null
+++ b/apps/user_ldap/lib/Migration/SetDefaultProvider.php
@@ -0,0 +1,58 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * @copyright 2020 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @author 2020 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace OCA\User_LDAP\Migration;
+
+use OCA\User_LDAP\Helper;
+use OCA\User_LDAP\LDAPProviderFactory;
+use OCP\IConfig;
+use OCP\Migration\IOutput;
+use OCP\Migration\IRepairStep;
+
+class SetDefaultProvider implements IRepairStep {
+
+	/** @var IConfig */
+	private $config;
+
+	/** @var Helper */
+	private $helper;
+
+	public function __construct(IConfig $config,
+								Helper $helper) {
+		$this->config = $config;
+		$this->helper = $helper;
+	}
+
+	public function getName(): string {
+		return 'Set default LDAP provider';
+	}
+
+	public function run(IOutput $output): void {
+		$current = $this->config->getSystemValue('ldapProviderFactory', null);
+		if ($current === null) {
+			$this->config->setSystemValue('ldapProviderFactory', LDAPProviderFactory::class);
+		}
+	}
+}