diff --git a/setup/migrate/config/commercial_config.xml b/setup/migrate/config/commercial_config.xml
index a41216e..515155a 100644
--- a/setup/migrate/config/commercial_config.xml
+++ b/setup/migrate/config/commercial_config.xml
@@ -10,8 +10,8 @@
";
+ return false;
+ } else {
+ $this->temp_variables['services']['KTMysql']['class'] = "tick";
+ $this->temp_variables['services']['KTMysql']['name'] = "KTMysql";
+ $this->temp_variables['services']['KTMysql']['msg'] = "Service has been uninstalled";
+ return true;
+ }
+ }
+
+ /**
* Set all silent mode varibles
*
*/
diff --git a/setup/migrate/steps/migrateDatabase.php b/setup/migrate/steps/migrateDatabase.php
index 179d212..bd6746c 100644
--- a/setup/migrate/steps/migrateDatabase.php
+++ b/setup/migrate/steps/migrateDatabase.php
@@ -168,8 +168,8 @@ class migrateDatabase extends Step
}
$cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile;
if($noFile) {
- $this->error[]['error'] = "Could not connect to the KnowledgeTree Database";
- $this->error[]['msg'] = "Make sure all KnowledgeTree Services are running.";
+ $this->error[]['error'] = "The KnowledgeTree Setup Wizard was unable to connect to your KnowledgeTree 3.6.1 database";
+ $this->error[]['msg'] = "Please ensure that all KnowledgeTree Services are running.";
$this->error[]['cmd'] = "
Click Next after resolving the above errors.
"; $this->temp_variables['manual_export'] = ""; } else { diff --git a/setup/migrate/steps/migrateServices.php b/setup/migrate/steps/migrateServices.php index b1f0aed..a701639 100644 --- a/setup/migrate/steps/migrateServices.php +++ b/setup/migrate/steps/migrateServices.php @@ -116,6 +116,7 @@ class migrateServices extends Step protected $conf = array(); + protected $mysqlServiceName = "KTMysql"; /** * Main control of services setup * @@ -186,9 +187,23 @@ class migrateServices extends Step } private function mysqlRunning() { - $installation = $this->getDataFromSession("installation"); // Get installation directory - $mysqlPid = $installation['location'].DS."mysql".DS."data".DS."mysqld.pid"; - if(file_exists($mysqlPid)) { + $running = false; + if(WINDOWS_OS) { + $cmd = "sc query {$this->mysqlServiceName}"; + $response = $this->util->pexec($cmd); + if($response['out']) { + $state = preg_replace('/^STATE *\: *\d */', '', trim($response['out'][3])); // Status store in third key + } + if($state == "STARTED") { + return true; + } + } else { + $installation = $this->getDataFromSession("installation"); // Get installation directory + $mysqlPid = $installation['location'].DS."mysql".DS."data".DS."mysqld.pid"; + if(file_exists($mysqlPid)) + $running = true; + } + if(file_exists($running)) { return true; } return false; @@ -247,6 +262,12 @@ class migrateServices extends Step $serv->uninstall(); } } + $this->shutdownMysql(); + } + + private function shutdownMysql() { + $cmd = "sc stop {$this->mysqlServiceName}"; + $response = $this->util->pexec($cmd); } /** @@ -287,9 +308,23 @@ class migrateServices extends Step * */ private function checkMysql() { - $installation = $this->getDataFromSession("installation"); // Get installation directory - $mysqlPid = $installation['location'].DS."mysql".DS."data".DS."mysqld.pid"; - if(file_exists($mysqlPid)) { + $running = false; + if(WINDOWS_OS) { + $cmd = "sc query {$this->mysqlServiceName}"; + $response = $this->util->pexec($cmd); + if($response['out']) { + $state = preg_replace('/^STATE *\: *\d */', '', trim($response['out'][3])); // Status store in third key + } + if($state == "STARTED") { + return true; + } + } else { + $installation = $this->getDataFromSession("installation"); // Get installation directory + $mysqlPid = $installation['location'].DS."mysql".DS."data".DS."mysqld.pid"; + if(file_exists($mysqlPid)) + $running = true; + } + if($running) { $this->temp_variables['services']['KTMysql']['class'] = "cross"; $this->temp_variables['services']['KTMysql']['name'] = "KTMysql"; $this->temp_variables['services']['KTMysql']['msg'] = "Service Running"; diff --git a/setup/migrate/templates/database.tpl b/setup/migrate/templates/database.tpl index da30653..bc2e993 100644 --- a/setup/migrate/templates/database.tpl +++ b/setup/migrate/templates/database.tpl @@ -11,8 +11,7 @@ //print_r($errors); ?> -The Setup Wizard will now migrate your existing database to the new Zend Server stack. This process may take - several minutes to complete.
The Setup Wizard will now export your existing database in preparation for the migration to the new KnowledgeTree Stack.
- Enter the full path of the installation you wish to upgrade: + The Setup Wizard will now prepare your current KnowledgeTree database for migration to the new KnowledgeTree Stack. +
+ ++ Please enter the full path of the installation you wish to upgrade:
-- The default is 'C:\Program Files\ktdms' on Windows and '/opt/ktdms' or '/home/username/ktdms/' on other operating systems. -
-- - Make sure that the KnowledgeTree services are running. - -
-+ (The default is 'C:\Program Files\ktdms' on Windows and '/opt/ktdms' or '/home/username/ktdms/' on other operating systems.) +