execute(array())->fetchAll(); foreach ($result as $row) { \OC_Preferences::setValue($row['uid'], 'files_encryption', 'recovery_enabled', $row['recovery_enabled']); \OC_Preferences::setValue($row['uid'], 'files_encryption', 'migration_status', $row['migration_status']); } $deleteOldTable = 'DROP TABLE `*PREFIX*encryption`'; $query = \OCP\DB::prepare($deleteOldTable); $query->execute(array()); }