I updated some commands in Workspace restore

This commit is contained in:
Paula Quispe
2017-02-16 12:41:25 -04:00
parent c906642651
commit df6b3ac4ae

View File

@@ -1576,8 +1576,11 @@ class workspaceTools
* workspace, or overwriting a previous one * workspace, or overwriting a previous one
* *
* @param string $filename the backup filename * @param string $filename the backup filename
* @param string $newWorkspaceName if defined, supplies the name for the * @param string $srcWorkspace name of the source workspace
* workspace to restore to * @param string $dstWorkspace name of the destination workspace
* @param string $overwrite if you need overwrite the database
* @param string $lang for define the language
* @param string $port of database if is empty take 3306
*/ */
static public function restore($filename, $srcWorkspace, $dstWorkspace = null, $overwrite = true, $lang = 'en', $port = '') static public function restore($filename, $srcWorkspace, $dstWorkspace = null, $overwrite = true, $lang = 'en', $port = '')
{ {
@@ -1621,10 +1624,6 @@ class workspaceTools
$version = System::getVersion(); $version = System::getVersion();
$pmVersion = (preg_match("/^([\d\.]+).*$/", $version, $arrayMatch)) ? $arrayMatch[1] : ""; //Otherwise: Branch master $pmVersion = (preg_match("/^([\d\.]+).*$/", $version, $arrayMatch)) ? $arrayMatch[1] : ""; //Otherwise: Branch master
/*if($pmVersion == '' && strpos(strtoupper($version), 'BRANCH')){
$pmVersion = 'dev-version-backup';
}*/
CLI::logging(CLI::warning(" CLI::logging(CLI::warning("
Warning: A workspace from a newer version of ProcessMaker can NOT be restored in an older version of Warning: A workspace from a newer version of ProcessMaker can NOT be restored in an older version of
ProcessMaker. For example, restoring from v.3.0 to v.2.5 will not work. However, it may be possible ProcessMaker. For example, restoring from v.3.0 to v.2.5 will not work. However, it may be possible
@@ -1757,8 +1756,6 @@ class workspaceTools
} }
} }
//CLI::logging(CLI::info("$pmVersionWorkspaceToRestore < $pmVersion") . "\n");
if (($pmVersionWorkspaceToRestore != '') && (version_compare($pmVersionWorkspaceToRestore . "", if (($pmVersionWorkspaceToRestore != '') && (version_compare($pmVersionWorkspaceToRestore . "",
$pmVersion . "", "<") || $pmVersion == "") $pmVersion . "", "<") || $pmVersion == "")
) { ) {
@@ -1803,18 +1800,35 @@ class workspaceTools
$pmVersion = 'dev-version-backup'; $pmVersion = 'dev-version-backup';
} }
//Move the labels of content to the corresponding table
$start = microtime(true);
CLI::logging("> Optimizing content data...\n");
$workspace->migrateContent($workspace->name, $lang);
$stop = microtime(true);
CLI::logging("<*> Optimizing content data took " . ($stop - $start) . " seconds.\n");
//Move the data of cases to the corresponding List
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
if (($pmVersionWorkspaceToRestore != '') && (version_compare($pmVersionWorkspaceToRestore . "", "2.9", $start = microtime(true);
"<") || $pmVersion == "") CLI::logging("> Updating List tables...\n");
) { $workspace->migrateList($workspace->name, false, $lang);
$start = microtime(true); $stop = microtime(true);
CLI::logging("> Updating List tables...\n"); CLI::logging("<*> Updating List Process took " . ($stop - $start) . " seconds.\n");
$workspace->migrateList($workspace->name, false, $lang);
$stop = microtime(true);
CLI::logging("<*> Updating List Process took " . ($stop - $start) . " seconds.\n");
}
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$start = microtime(true);
CLI::logging("> Updating Files Manager...\n");
$workspace->processFilesUpgrade();
$stop = microtime(true);
CLI::logging("<*> Updating Files Manager took " . ($stop - $start) . " seconds.\n");
//Populate the new fields for replace string UID to Interger ID
$start = microtime(true);
CLI::logging("> Migrating and populating indexing for APP_CACHE_VIEW...\n");
$workspace->migratePopulateIndexingACV($workspace->name);
$stop = microtime(true);
CLI::logging("<*> Migrating an populating indexing for APP_CACHE_VIEW process took " . ($stop - $start) . " seconds.\n");
mysql_close($link); mysql_close($link);
} }