diff --git a/setup/migrate/config/commercial_config.xml b/setup/migrate/config/commercial_config.xml
index d394269..769e3bd 100644
--- a/setup/migrate/config/commercial_config.xml
+++ b/setup/migrate/config/commercial_config.xml
@@ -10,8 +10,8 @@
installation
- services
database
+ services
complete
\ No newline at end of file
diff --git a/setup/migrate/config/community_config.xml b/setup/migrate/config/community_config.xml
index d394269..769e3bd 100644
--- a/setup/migrate/config/community_config.xml
+++ b/setup/migrate/config/community_config.xml
@@ -10,8 +10,8 @@
installation
- services
database
+ services
complete
\ No newline at end of file
diff --git a/setup/migrate/migrateUtil.php b/setup/migrate/migrateUtil.php
index f1593a5..6792e23 100644
--- a/setup/migrate/migrateUtil.php
+++ b/setup/migrate/migrateUtil.php
@@ -50,7 +50,7 @@ class MigrateUtil extends InstallUtil {
* @param none
* @return boolean
*/
- public function isSystemMigrateed() {
+ public function isSystemMigrated() {
if (file_exists(dirname(__FILE__)."/migrate")) {
return true;
diff --git a/setup/migrate/migrateWizard.php b/setup/migrate/migrateWizard.php
index 25d079a..c13b6b9 100644
--- a/setup/migrate/migrateWizard.php
+++ b/setup/migrate/migrateWizard.php
@@ -5,7 +5,7 @@
* KnowledgeTree Community Edition
* Document Management Made Simple
* Copyright (C) 2008,2009 KnowledgeTree Inc.
-*
+*
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
@@ -98,10 +98,10 @@ class MigrateWizard {
* @param none
* @return boolean
*/
- private function isSystemMigrateed() {
- return $this->util->isSystemMigrateed();
+ private function isSystemMigrated() {
+ return $this->util->isSystemMigrated();
}
-
+
/**
* Display the wizard
*
@@ -119,7 +119,7 @@ class MigrateWizard {
$ins->step(); // Run step
}
}
-
+
/**
* Set bypass flag
*
@@ -131,7 +131,7 @@ class MigrateWizard {
private function setBypass($bypass) {
$this->bypass = $bypass;
}
-
+
/**
* Set util reference
*
@@ -143,7 +143,7 @@ class MigrateWizard {
private function setIUtil($util) {
$this->util = $util;
}
-
+
/**
* Get bypass flag
*
@@ -155,7 +155,7 @@ class MigrateWizard {
public function getBypass() {
return $this->bypass;
}
-
+
/**
* Bypass and force an migrate
*
@@ -165,9 +165,9 @@ class MigrateWizard {
* @return boolean
*/
private function bypass() {
-
+
}
-
+
/**
* Create migrate file
*
@@ -179,7 +179,7 @@ class MigrateWizard {
private function createMigrateFile() {
@touch("migrate");
}
-
+
/**
* Remove migrate file
*
@@ -191,7 +191,7 @@ class MigrateWizard {
private function removeMigrateFile() {
@unlink("migrate");
}
-
+
/**
* Load default values
*
@@ -206,7 +206,7 @@ class MigrateWizard {
}
$this->setIUtil(new MigrateUtil());
}
-
+
/**
* Run pre-migrateation system checks
*
@@ -232,7 +232,7 @@ class MigrateWizard {
break;
}
}
-
+
/**
* Control all requests to wizard
*
@@ -248,7 +248,7 @@ class MigrateWizard {
} elseif ($this->getBypass() === "0") {
$this->createMigrateFile();
}
- if(!$this->isSystemMigrateed()) { // Check if the systems not migrated
+ if(!$this->isSystemMigrated()) { // Check if the systems not migrated
$response = $this->systemChecks();
if($response === true) {
$this->displayMigrater();
diff --git a/setup/migrate/steps/migrateDatabase.php b/setup/migrate/steps/migrateDatabase.php
index 5842568..6d48052 100644
--- a/setup/migrate/steps/migrateDatabase.php
+++ b/setup/migrate/steps/migrateDatabase.php
@@ -1,6 +1,6 @@
previous()) {
return 'previous';
}
-
+
return 'landing';
}
@@ -145,7 +145,7 @@ class migrateDatabase extends Step
if(!$manual) { // Try to export database
$sqlFile = $tmpFolder."/kt-backup-$date.sql";
$cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile;
- $this->util->pexec($cmd);
+ $response = $this->util->pexec($cmd);
}
if(file_exists($sqlFile)) {
$fileContents = file_get_contents($sqlFile);
@@ -156,19 +156,35 @@ class migrateDatabase extends Step
}
// Handle failed dump
if(WINDOWS_OS) {
- $sqlFile = "C:\\kt-backup-$date.sql"; // Use tmp instead due to permissions
+ // Could be permissions, check error code.
+ if($response['ret'] == 2) {
+
+ } else {
+ $sqlFile = "C:\\kt-backup-$date.sql"; // Use tmp instead due to permissions
+ }
} else {
- $sqlFile = "/tmp/kt-backup-$date.sql"; // Use tmp instead due to permissions
+ if($response['ret'] == 2) {
+
+ } else {
+ $sqlFile = "/tmp/kt-backup-$date.sql"; // Use tmp instead due to permissions
+ }
}
$cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile;
- $this->error[]['error'] = "Could not export database:";
- $this->error[]['msg'] = "Execute the following command in a $termOrBash.";
- $this->error[]['cmd'] = $cmd;
- $this->temp_variables['manual_export'] = $sqlFile;
-
+ if($response['ret'] == 2) {
+ $this->error[]['error'] = "Could not connect to KnowledgeTree Database";
+ $this->error[]['msg'] = "Make sure all KnowledgeTree Services are running.";
+ $this->error[]['cmd'] = "
Click Next after resolving the above errors.
";
+ $this->temp_variables['manual_export'] = "a";
+ } else {
+ $this->error[]['error'] = "Could not export database:";
+ $this->error[]['msg'] = "Execute the following command in a $termOrBash.";
+ $this->error[]['cmd'] = $cmd;
+ $this->temp_variables['manual_export'] = $sqlFile;
+ }
+
return false;
}
-
+
// TODO
function resolveTempDir() {
if (!WINDOWS_OS) {
@@ -179,7 +195,7 @@ class migrateDatabase extends Step
if (!is_dir($dir)) {
mkdir($dir);
}
-
+
return $dir;
}
@@ -197,10 +213,10 @@ class migrateDatabase extends Step
$this->temp_variables['dumpLocation'] = $this->getPostSafe('dumpLocation');
$this->createMigrateFile(); // create lock file to indicate migration mode
}
-
+
/**
* Creates migration lock file so that system knows it is supposed to run an upgrade installation
- *
+ *
* @author KnowledgeTree Team
* @access private
* @return void
@@ -208,7 +224,7 @@ class migrateDatabase extends Step
private function createMigrateFile() {
@touch(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock");
}
-
+
/**
* Safer way to return post data
*
@@ -220,7 +236,7 @@ class migrateDatabase extends Step
public function getPostSafe($key) {
return isset($_POST[$key]) ? $_POST[$key] : "";
}
-
+
/**
* Stores varibles used by template
*
@@ -244,7 +260,7 @@ class migrateDatabase extends Step
public function getErrors() {
return $this->error;
}
-
+
/**
* Initialize errors to false
*
@@ -258,12 +274,12 @@ class migrateDatabase extends Step
$this->error[$e] = false;
}
}
-
+
private function storeSilent() {
// TODO
$_SESSION['migrate']['database']['dumpLocation'] = $this->sqlDumpFile;
$this->temp_variables['dumpLocation'] = $this->sqlDumpFile;
}
-
+
}
?>
\ No newline at end of file
diff --git a/setup/migrate/steps/migrateInstallation.php b/setup/migrate/steps/migrateInstallation.php
index 6c1e159..0718624 100644
--- a/setup/migrate/steps/migrateInstallation.php
+++ b/setup/migrate/steps/migrateInstallation.php
@@ -1,6 +1,6 @@
temp_variables = array("step_name"=>"installation", "silent"=>$this->silent);
$this->detectInstallation();
@@ -122,8 +122,8 @@ class migrateInstallation extends step
return 'next';
}
$this->doRun();
-
- return 'landing';
+
+ return 'landing';
}
public function detectInstallation() {
@@ -141,7 +141,7 @@ class migrateInstallation extends step
}
}
}
-
+
public function doRun() {
if(!$this->readConfig()) {
$this->storeSilent();
@@ -154,7 +154,7 @@ class migrateInstallation extends step
$this->storeSilent();
return true;
}
-
+
}
public function checkVersion() {
@@ -163,10 +163,10 @@ class migrateInstallation extends step
$this->error[] = "KT installation needs to be 3.6.1 or higher";
return false;
}
-
+
return true;
}
-
+
public function readVersion() {
$verFile = $this->location."/knowledgeTree/docs/VERSION.txt";
if(file_exists($verFile)) {
@@ -176,25 +176,25 @@ class migrateInstallation extends step
$this->error[] = "KT installation version not found";
}
- return false;
+ return false;
}
-
+
public function readConfig() {
if(isset($_POST['location'])) {
$ktInstallPath = $_POST['location'];
if($ktInstallPath != '' || strlen($ktInstallPath) == 0) {
$this->location = $ktInstallPath;
-
+
return $this->configExists($ktInstallPath);
- }
+ }
} else {
-
+
return false;
}
return false;
}
-
+
private function configExists($ktInstallPath) {
if(file_exists($ktInstallPath)) {
$configPath = $ktInstallPath.DS."knowledgeTree".DS."config".DS."config-path";
@@ -203,7 +203,7 @@ class migrateInstallation extends step
if(file_exists($configFilePath)) { // For 3.7 and after
$this->loadConfig($configFilePath);
$this->storeSilent();
-
+
return true;
} else {
$configFilePath = $ktInstallPath.DS."knowledgeTree".DS.$configFilePath; // For older than 3.6.2
@@ -211,7 +211,7 @@ class migrateInstallation extends step
if(file_exists($configFilePath)) {
$this->loadConfig($configFilePath);
$this->storeSilent();
-
+
return true;
}
$this->error[] = "KT installation configuration file empty";
@@ -222,10 +222,10 @@ class migrateInstallation extends step
} else {
$this->error[] = "Please Enter a Location";
}
-
+
return false;
}
-
+
private function loadConfig($path) {
$this->util->iniUtilities->load($path);
$dbSettings = $this->util->iniUtilities->getSection('db');
@@ -233,7 +233,6 @@ class migrateInstallation extends step
'dbName'=> $dbSettings['dbName'],
'dbUser'=> $dbSettings['dbUser'],
'dbPass'=> $dbSettings['dbPass'],
- 'dbPort'=> $this->util->getPort($this->location),
'dbAdminUser'=> $dbSettings['dbAdminUser'],
'dbAdminPass'=> $dbSettings['dbAdminPass'],
);
@@ -253,11 +252,12 @@ class migrateInstallation extends step
array('name'=> 'Cache Directory', 'path'=> $varDir.DS.'cache'),
array('name'=> 'Upload Directory', 'path'=> $varDir.DS.'uploads'),
);
+ $this->dbSettings['dbPort'] = $this->util->getPort($this->location); // Add Port
$this->temp_variables['urlPaths'] = $this->urlPaths;
$this->temp_variables['ktSettings'] = $this->ktSettings;
$this->temp_variables['dbSettings'] = $this->dbSettings;
}
-
+
private function setDetails() {
$inst = $this->getDataFromSession("installation");
if ($inst) {
@@ -266,7 +266,7 @@ class migrateInstallation extends step
}
}
}
-
+
public function getStepVars() {
return $this->temp_variables;
}
@@ -274,13 +274,13 @@ class migrateInstallation extends step
public function getErrors() {
return $this->error;
}
-
+
public function storeSilent() {
if($this->location==1) { $this->location = '';}
$this->temp_variables['location'] = $this->location;
$this->temp_variables['foundVersion'] = $this->foundVersion;
$this->temp_variables['versionError'] = $this->versionError;
$this->temp_variables['settings'] = $this->settings;
- }
+ }
}
?>
\ No newline at end of file
diff --git a/setup/migrate/templates/database.tpl b/setup/migrate/templates/database.tpl
index 3723bd4..ef06289 100644
--- a/setup/migrate/templates/database.tpl
+++ b/setup/migrate/templates/database.tpl
@@ -2,17 +2,20 @@
Migrate Database
- This step configures the connection to the database server and migrates the database.
+ This step configures the connection to the database server and migrates the database.
+
The Setup Wizard will now migrate your existing database to the new Zend Server stack. This process may take
several minutes to complete.
Please ensure that your database is backed up before proceeding. If you need assistance with backing up see the 'Backing up and restoring KnowledgeTree' wiki entry.
Click Next to continue.
+
+
-
+
" method="post" id="">
Deactivate Services
-
+
All KnowledgeTree services need to be deactivated before the migration takes place.
@@ -34,7 +34,7 @@
-
+
All services are uninstalled.
@@ -48,7 +48,7 @@
$display = 'none';
}
?>
-
+
diff --git a/setup/wizard/installUtil.php b/setup/wizard/installUtil.php
index 7e444d6..e54c025 100644
--- a/setup/wizard/installUtil.php
+++ b/setup/wizard/installUtil.php
@@ -939,7 +939,7 @@ class InstallUtil {
}
return join(" ", $aSafeArgs);
}
-
+
/**
* The system identifier is a unique ID defined in every installation of KnowledgeTree
*
@@ -948,14 +948,14 @@ class InstallUtil {
function getSystemIdentifier($db = true)
{
$sIdentifier = null;
-
+
if ($db) {
$sIdentifier = $this->getSystemSetting('kt_system_identifier');
}
-
+
if (empty($sIdentifier)) {
// if we have one from the session, simply return that one
- if (isset($_SESSION['installers']['registration']['installation_guid'])
+ if (isset($_SESSION['installers']['registration']['installation_guid'])
&& !empty($_SESSION['installers']['registration']['installation_guid'])) {
$sIdentifier = $_SESSION['installers']['registration']['installation_guid'];
}
@@ -968,7 +968,7 @@ class InstallUtil {
}
return $sIdentifier;
}
-
+
function setSystemSetting($name, $value)
{
// we either need to insert or update:
@@ -982,14 +982,14 @@ class InstallUtil {
// update
$query = 'UPDATE ' . $sTable . ' SET value = "' . $value . '" WHERE name = "' . $name . '"';
}
-
+
$res = $this->dbUtilities->query($query);
$errors = $this->dbUtilities->getErrors();
if (count($errors)) { return false; }
-
+
return true;
}
-
+
function getSystemSetting($name, $default = null)
{
// XXX make this use a cache layer?
@@ -1009,7 +1009,7 @@ class InstallUtil {
return $result[$name];
}
-
+
// {{{ getTableName
/**
* The one true way to get the correct name for a table whilst
@@ -1024,7 +1024,7 @@ class InstallUtil {
return $sTable;
}
// }}}
-
+
/*
Just Because.
*/
diff --git a/setup/wizard/resources/css/migrate.css b/setup/wizard/resources/css/migrate.css
index 87c9855..e72be3f 100644
--- a/setup/wizard/resources/css/migrate.css
+++ b/setup/wizard/resources/css/migrate.css
@@ -25,3 +25,7 @@
padding: 5px;
/*min-height:360px;*/min-height:295px;
}
+
+.notop {
+ top:0px;
+}
\ No newline at end of file