private function updateDownloads()
 {
     echo "Updating downloads to new mediamanager structure...\n";
     echo "<b>Please note: Permission-Settings can't be migrated. Please adopt the permissions, e.g. to download manually.</b>\n";
     if (!in_array(_dbprefix_ . "downloads_archive", $this->objDB->getTables())) {
         echo "Downloads table missing, no update required.\n";
         return true;
     }
     echo "Migrating old archives to new mediamanager repos...\n";
     $strQuery = "SELECT * FROM " . _dbprefix_ . "downloads_archive";
     $arrArchives = $this->objDB->getPArray($strQuery, array());
     foreach ($arrArchives as $arrOneArchive) {
         //load foreign repo data
         $strQuery = "SELECT * FROM " . _dbprefix_ . "filemanager WHERE filemanager_foreign_id = ?";
         $arrRepoData = $this->objDB->getPRow($strQuery, array($arrOneArchive["archive_id"]));
         echo "migrating old archive " . $arrOneArchive["archive_title"] . "\n";
         echo "  old path: " . $arrRepoData["filemanager_path"] . "\n";
         //convert the path
         $strPath = $this->convertOldPath($arrRepoData["filemanager_path"]);
         echo "  new path: " . $strPath . "\n";
         $objRepo = new class_module_mediamanager_repo();
         $objRepo->setStrPath($strPath);
         $objRepo->setStrTitle($arrOneArchive["archive_title"]);
         $objRepo->setStrViewFilter($arrRepoData["filemanager_view_filter"]);
         $objRepo->setStrUploadFilter($arrRepoData["filemanager_upload_filter"]);
         $objRepo->updateObjectToDb();
         $objRepo->syncRepo();
         echo "deleting old filemanager repo...\n";
         $strQuery = "DELETE FROM " . _dbprefix_ . "filemanager WHERE filemanager_id = ?";
         $this->objDB->_pQuery($strQuery, array($arrRepoData["filemanager_id"]));
         $this->deleteSystemRecord($arrRepoData["filemanager_id"]);
         echo "migrating downloads data...\n";
         $this->updateDownloadsLevel($objRepo->getSystemid(), $arrOneArchive["archive_id"]);
         echo "updating existing downloads-elements...\n";
         $strQuery = "UPDATE " . _dbprefix_ . "element_downloads SET download_id = ? WHERE download_id = ?";
         $this->objDB->_pQuery($strQuery, array($objRepo->getSystemid(), $arrOneArchive["archive_id"]));
         echo "deleting downloads-toplist element...\n";
         $objElement = class_module_pages_element::getElement("downloadstoplist");
         if ($objElement != null) {
             $objElement->deleteObjectFromDatabase();
         }
         echo "deleting old adminwidgets...\n";
         $arrWidgets = class_module_dashboard_widget::getAllWidgets();
         foreach ($arrWidgets as $objOneWidget) {
             if ($objOneWidget->getStrClass() == "class_adminwidget_downloads") {
                 $objOneWidget->deleteObjectFromDatabase();
             }
         }
         echo "deleting archive and contained downloads data...\n";
         $this->deleteDownloadsLevel($arrOneArchive["archive_id"]);
         $this->objDB->_pQuery("DELETE FROM " . _dbprefix_ . "downloads_archive WHERE archive_id = ?", array($arrOneArchive["archive_id"]));
         $this->deleteSystemRecord($arrOneArchive["archive_id"]);
     }
     echo "Migrating old log-table...\n";
     $this->objDB->_pQuery("INSERT INTO " . _dbprefix_ . "mediamanager_dllog SELECT * FROM " . _dbprefix_ . "downloads_log", array());
     echo "Deleting downloads module...\n";
     $this->removeModule("downloads");
     $this->objDB->_pQuery("DROP TABLE " . _dbprefix_ . "downloads_archive", array());
     $this->objDB->_pQuery("DROP TABLE " . _dbprefix_ . "downloads_file", array());
     $this->objDB->_pQuery("DROP TABLE " . _dbprefix_ . "downloads_log", array());
     $this->removeSetting("_downloads_suche_seite_");
     return true;
 }