2007-08-20 Sancho Lerena <slerena@artica.es>

* migrate.php renamed to upgrade.php

        * Deleted old upgrade scripts from 1.1

        * Updated install.php.

        * Updated Index.php version to Beta2 :-)



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@604 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2007-08-20 14:29:01 +00:00
parent 857395e01a
commit 896e1ae63a
7 changed files with 19 additions and 237 deletions

View File

@ -1,3 +1,14 @@
2007-08-20 Sancho Lerena <slerena@artica.es>
* migrate.php renamed to upgrade.php
* Deleted old upgrade scripts from 1.1
* Updated install.php.
* Updated Index.php version to Beta2 :-)
2007-08-17 Sancho Lerena <slerena@artica.es>
* Updated Pandora FMS logo :-) (Thanks Silvia!)
@ -12,7 +23,8 @@
* pandoradb_12_to_13.sql: Fixed some items.
* reporting/fgraph.php: Fixed problem (NOTICE string) rendering boolean graphs.
* reporting/fgraph.php: Fixed problem (NOTICE string) rendering
boolean graphs.
* migrate.php: Upgraded and finished migration tool from 1.2 to 1.3 :-)

View File

@ -25,9 +25,9 @@
//Pandora Version
if (!isset($build_version))
$build_version="PC070622";
$build_version="PC070820";
if (!isset($pandora_version))
$pandora_version="v1.3 Beta 1";
$pandora_version="v1.3 Beta 2";
// Database configuration (default ones)
//$dbname="pandora13"; // MySQL DataBase

View File

@ -24,8 +24,8 @@
// Pandora FMS 1.x uses Pear Image::Graph code
//Pandora Version, if not defined here it would take from config.php
$build_version="PC070808";
$pandora_version="v1.3-dev";
$build_version="PC070820";
$pandora_version="v1.3 Beta2";
global $build_version;
global $pandora_version;

View File

@ -163,7 +163,8 @@ function install_step1() {
echo "<div class='warn'><b>Warning:</b> You already have a config.php file. Configuration and database would be overwritten if you continued.</div>";
}
echo "<div class='warn'><b>Warning:</b> This installer will <b>overwrite and destroy</b> your existing Pandora FMS configuration and <b>Database</b>. Before contine, please <b>be sure that you have no valuable Pandora FMS data in your Database.</b><br></div>";
echo "<div class='info'>If you want to <b>upgrade</b> Pandora FMS 1.2 to 1.3 version, use the <a href='migrate.php'>automated migration wizard</a></div>";
echo "<div class='info'>If you want to <b>upgrade</b> Pandora FMS 1.2 to 1.3 version, use the <a
href='upgrade.php'>automated update wizard</a></div>";
echo "
</div>
<div id='logo_img'>

View File

@ -1,45 +0,0 @@
Migrate Pandora 1.1 to Pandora 1.2
==================================
You need a script called pandoradb_1.1_to_1.2.sql provided in Pandora Console Package for 1.2 version. Migrate 1.1 to 1.2 versions includes:
a) Full replacement of Pandora Console PHP Code (backup your original one to replace values in /include/config.php for your login, password, hostname to connect database).
b) Full replacement of Pandora Server PERL Code (backyou your original one to replace values in pandora_server.conf. The new pandora_server.conf is located at /conf directory. It's possible that you need to change incoming dir, or parameters into daemon scripts. Please recheck Pandora Server 1.2 documentation before try to run it.
c) Read documentation about new features of Pandora 1.2.
Migration process doesnt delete any data, you don't loss any agente, config, or enviroment data, but please, read _carefully_ all documentation about this process before trying it.
Migration steps
---------------
0. You need to stop Pandora Server before any changes in database. Think that you dont loose any data in the process of migration because agent data will be stored in incoming directory. Move this data to the new incoming directory before launch the new server, and you process that data without miss anything.
1. DUMP all tagente_datos records to a safe file, for example
mysqldump --no-create-info -u root -p pandora tagente_datos > /tmp/pandora.conv.tmp
2. Run migration SQL script, for example:
cat pandoradb_1.1_to_1.2.sql | mysql -u root -p -D pandora
PLEASE NOTE THAT this script WILL DROP your data table, so please DONT SKIP step #1.
3. Reimport data writen in first step, for example:
cat /tmp/pandora.conv.tmp | mysql -u root -p -D pandora
4. Delete temporal files, for example:
rm -Rf /tmp/pandora.conv.tmp
Code upgrade
------------
Simply backup your Pandora Console and Pandora Server install and proceed as if Pandora 1.2 was a new installation. Use your configuration values your the new configuration files in Pandora and Server components. Database migration is the "heavy" task, and need to be made before using new code.
Final step
----------
Start your new Pandora components. Start your new Pandora components. Enter the WEB console and check that a new "server" has been created. Please, edit each agent you have and assign this new server for each agent. This process could be automated using SQL, and you only need to do once.

View File

@ -1,186 +0,0 @@
-- Pandora 1.1 to 1.2 SQL Migration script
-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-- CAUTION, BEFORE RUNNING THIS FILE, READ DOCUMENTATION
-- ABOUT HOW TO MIGRATE FROM PANDORA 1.1 to 1.2 VERSION
-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-- Quick guide for migration:
-- 1th
-- DUMP all tagente_datos records to a safe file
-- for example
-- mysqldump --no-create-info -u root -p pandora tagente_datos > /tmp/pandora.conv.tmp
-- 2th
-- Run this SQL script, for example
-- cat pandoradb_1.1_to_1.2.sql | mysql -u root -p -D pandora
-- 3th
-- Reimport data from first step
-- cat /tmp/pandora.conv.tmp | mysql -u root -p -D pandora
-- 4th
-- Delete /tmp/pandora.conv.tmp file (rm -f /tmp/pandora.conv.tmp)
CREATE TABLE `tagent_access` (
`id_ac` bigint(20) unsigned NOT NULL auto_increment,
`id_agent` int(11) NOT NULL default '0',
`timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id_ac`),
KEY `agent_index` (`id_agent`)
) TYPE=InnoDB;
ALTER TABLE talerta_agente_modulo MODIFY COLUMN al_campo3 tinytext default '';
ALTER TABLE tagente ADD column agent_type int(2) unsigned NOT NULL default '0';
ALTER TABLE tagente ADD column id_server int(4) unsigned NOT NULL default '0';
ALTER TABLE tagente_datos_string MODIFY COLUMN datos mediumtext NOT NULL;
ALTER TABLE tagente_estado ADD column `id_agente` int(11) NOT NULL default '0' AFTER estado;
ALTER TABLE tagente_estado ADD column `last_try` datetime default NULL AFTER id_agente;
ALTER TABLE tagente_modulo ADD column `module_interval` int(4) unsigned default '0' AFTER min;
ALTER TABLE tagente_modulo ADD column `tcp_port` int(4) unsigned default '0' AFTER module_interval;
ALTER TABLE tagente_modulo ADD column `tcp_send` varchar(150) default '' AFTER tcp_port;
ALTER TABLE tagente_modulo ADD column `tcp_rcv` varchar(100) default '' AFTER tcp_send;
ALTER TABLE tagente_modulo ADD column `snmp_community` varchar(100) default '' AFTER tcp_rcv;
ALTER TABLE tagente_modulo ADD column `snmp_oid` varchar(255) default '0' AFTER snmp_community;
ALTER TABLE tagente_modulo ADD column `ip_target` varchar(100) default '' AFTER snmp_oid;
ALTER TABLE tagente_modulo ADD column `id_module_group` int(4) unsigned default '0' AFTER ip_target;
ALTER TABLE tagente_modulo ADD column `flag` tinyint(3) unsigned default '0' AFTER id_module_group;
CREATE TABLE `talert_snmp` (
`id_as` int(10) unsigned NOT NULL auto_increment,
`id_alert` int(10) unsigned NOT NULL default '0',
`al_field1` varchar(100) NOT NULL default '',
`al_field2` varchar(255) NOT NULL default '',
`al_field3` varchar(255) NOT NULL default '',
`description` varchar(255) default '',
`alert_type` int(2) unsigned NOT NULL default '0',
`agent` varchar(100) default '',
`custom_oid` varchar(200) default '',
`oid` varchar(255) NOT NULL default '',
`time_threshold` int(11) NOT NULL default '0',
`times_fired` int(2) unsigned NOT NULL default '0',
`last_fired` datetime NOT NULL default '0000-00-00 00:00:00',
`max_alerts` int(11) NOT NULL default '1',
`min_alerts` int(11) NOT NULL default '1',
`internal_counter` int(2) unsigned NOT NULL default '0',
PRIMARY KEY (`id_as`)
) TYPE=InnoDB;
ALTER TABLE talerta_agente_modulo ADD column `module_type` int(11) NOT NULL default '0' AFTER times_fired;
ALTER TABLE talerta_agente_modulo ADD column `min_alerts` int(4) NOT NULL default '0' AFTER module_type;
ALTER TABLE talerta_agente_modulo ADD column `internal_counter` int(4) default '0' AFTER min_alerts;
ALTER TABLE tgrupo ADD column `icon` varchar(50) default NULL AFTER nombre;
CREATE TABLE `tlanguage` (
`id_language` char(5) NOT NULL default '',
`name` varchar(100) NOT NULL default '',
PRIMARY KEY (`id_language`)
) TYPE=InnoDB;
CREATE TABLE `tmensajes` (
`id_mensaje` bigint(20) unsigned NOT NULL auto_increment,
`id_usuario_origen` varchar(100) NOT NULL default '',
`id_usuario_destino` varchar(100) NOT NULL default '',
`mensaje` mediumtext NOT NULL,
`timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
`subject` varchar(255) NOT NULL default '',
`estado` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id_mensaje`)
) TYPE=InnoDB;
CREATE TABLE `tmodule_group` (
`id_mg` bigint(20) unsigned NOT NULL auto_increment,
`name` varchar(150) NOT NULL default '',
PRIMARY KEY (`id_mg`)
) TYPE=InnoDB;
CREATE TABLE `tserver` (
`id_server` int(10) unsigned NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '',
`ip_address` varchar(100) NOT NULL default '',
`status` int(11) NOT NULL default '0',
`laststart` datetime NOT NULL default '0000-00-00 00:00:00',
`keepalive` datetime NOT NULL default '0000-00-00 00:00:00',
`snmp_server` int(6) NOT NULL default '1',
`network_server` int(11) NOT NULL default '0',
`data_server` int(11) NOT NULL default '0',
`master` smallint(6) NOT NULL default '1',
`checksum` smallint(6) NOT NULL default '1',
`description` varchar(255) NOT NULL default '',
PRIMARY KEY (`id_server`)
) TYPE=InnoDB;
ALTER TABLE ttipo_modulo ADD column `icon` varchar(100) default NULL AFTER descripcion;
CREATE TABLE `ttrap` (
`id_trap` bigint(20) unsigned NOT NULL auto_increment,
`source` varchar(50) NOT NULL default '',
`oid` varchar(255) NOT NULL default '',
`oid_custom` varchar(255) default '',
`type` int(11) NOT NULL default '0',
`type_custom` varchar(100) default '',
`value` varchar(255) default '',
`value_custom` varchar(255) default '',
`alerted` smallint(6) NOT NULL default '0',
`status` smallint(6) NOT NULL default '0',
`id_usuario` varchar(150) default '',
`timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id_trap`)
) TYPE=InnoDB COMMENT='SNMP Trap table';
UPDATE tconfig set value = "1.2" where token = "db_scheme_version";
UPDATE tconfig set value = "en" where token = "language_code";
INSERT INTO tconfig (token,value) VALUES ('db_scheme_buile','PD060926');
INSERT INTO tconfig (token,value) VALUES ('truetype','0');
INSERT INTO tconfig (token,value) VALUES ('graph_order','1');
INSERT INTO `tlanguage` VALUES ('bb','Bable');
INSERT INTO `tlanguage` VALUES ('en','English');
INSERT INTO `tlanguage` VALUES ('es_es','Espa&ntilde;ol');
INSERT INTO `tlanguage` VALUES ('es_la','Espa&ntilde;ol-Latinoam&eacute;rica');
INSERT INTO `tlanguage` VALUES ('eu','Euskera');
INSERT INTO `tlanguage` VALUES ('pt_br','Portuguese-Brazil');
INSERT INTO `tlanguage` VALUES ('fr','Fran&ccedil;ais');
INSERT INTO `tlanguage` VALUES ('ca','Catal&agrave;');
INSERT INTO `tmodule_group` VALUES (1,'General');
INSERT INTO `tmodule_group` VALUES (2,'Networking');
INSERT INTO `tmodule_group` VALUES (3,'Application');
INSERT INTO `tmodule_group` VALUES (4,'System');
INSERT INTO `tmodule_group` VALUES (5,'Miscellaneous');
UPDATE ttipo_modulo set icon = "mod_data.png" where nombre = "generic_data";
UPDATE ttipo_modulo set icon = "mod_proc.png" where nombre = "generic_proc";
UPDATE ttipo_modulo set icon = "mod_string.png" where nombre = "generic_data_string";
UPDATE ttipo_modulo set icon = "mod_data_inc.png" where nombre = "generic_data_inc";
INSERT INTO `ttipo_modulo` VALUES (6,'remote_icmp_proc',3,'Remote ICMP network agent, boolean data','mod_icmp_proc.png');
INSERT INTO `ttipo_modulo` VALUES (7,'remote_icmp',2,'Remote ICMP network agent (latency)','mod_icmp_data.png');
INSERT INTO `ttipo_modulo` VALUES (8,'remote_tcp',2,'Remote TCP network agent, numeric data','mod_tcp_data.png');
INSERT INTO `ttipo_modulo` VALUES (9,'remote_tcp_proc',3,'Remote TCP network agent, boolean data','mod_tcp_proc.png');
INSERT INTO `ttipo_modulo` VALUES (10,'remote_tcp_string',2,'Remote TCP network agent, alphanumeric data','mod_tcp_string.png');
INSERT INTO `ttipo_modulo` VALUES (11,'remote_tcp_inc',2,'Remote TCP network agent, incremental data','mod_tcp_inc.png');
INSERT INTO `ttipo_modulo` VALUES (12,'remote_udp_proc',3,'Remote UDP network agent, boolean data','mod_udp_proc.png');
INSERT INTO `ttipo_modulo` VALUES (15,'remote_snmp',2,'Remote SNMP network agent, numeric data','mod_snmp_data.png');
INSERT INTO `ttipo_modulo` VALUES (16,'remote_snmp_inc',2,'Remote SNMP network agent, incremental data','mod_snmp_inc.png');
INSERT INTO `ttipo_modulo` VALUES (17,'remote_snmp_string',2,'Remote SNMP network agent, alphanumeric data','mod_snmp_string.png');
INSERT INTO `ttipo_modulo` VALUES (18,'remote_snmp_proc',1,'Remote SNMP network agent, boolean data','mod_snmp_proc.png');
UPDATE tgrupo set icon = "others";
UPDATE tgrupo set icon = "servers" where nombre = "Servers";
UPDATE tgrupo set icon = "ids" where nombre = "IDS";
UPDATE tgrupo set icon = "firewall" where nombre = "Firewall";
UPDATE tgrupo set icon = "db" where nombre = "Databases";
UPDATE tgrupo set icon = "comms" where nombre = "Comms";
UPDATE tgrupo set icon = "others" where nombre like "Other%";
UPDATE tgrupo set icon = "workstation" where nombre = "Workstations";
UPDATE tgrupo set icon = "apps" where nombre = "Applications";
INSERT INTO `tconfig_os` VALUES ('Network','Pandora Network Agent','network.png');
DROP TABLE tagente_datos;
CREATE TABLE `tagente_datos` (
`id_agente_datos` bigint(10) unsigned NOT NULL auto_increment,
`id_agente_modulo` bigint(4) NOT NULL default '0',
`datos` double(18,2) default NULL,
`timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
`id_agente` bigint(4) unsigned NOT NULL default '0',
PRIMARY KEY (`id_agente_datos`),
KEY `data_index_1` (`id_agente_modulo`),
KEY `data_index_2` (`id_agente`),
KEY `data_index_3` (`timestamp`)
) TYPE=InnoDB;