Announcement

Collapse
No announcement yet.

Migrating FAN to Centreon 3.3

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Migrating FAN to Centreon 3.3

    Hi,
    I'm just migrating FAN (centreon 2.4) to Centreon 3.3.

    The steps I have done is:
    1. Install an ISO with Centreon 3.3 and do a clean install
    2. Stop all centreon services
    3. Dump database from old centreon and import to new centreon install (dumped centreon2, imported to centreon, also for centreon2_storage to centreon_storage)
    4. Tried to login (login was ok and appeared services and hosts)
    5. Copied the install directory [root@centreon www]# cp ../installDir/install-2.7.0-20160718_021956 . (<RandomName> Directory was not on /usr/share/centreon/www/)
    6. Logout and proceed with upgrade
    7. Now I found that appears me the message:
    2.4.1 to 2.4.2 Database Error: Could not connect to database.
    Please contact your administrator.

    I tryied to search on forums about migrating and do that:
    [root@centreon www]# mysql

    MariaDB [(none)]> use centreon;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Database changed
    MariaDB [centreon]> update cfg_ndo2db set db_name = "centreon_status";
    Query OK, 1 row affected (0.01 sec)
    Rows matched: 1 Changed: 1 Warnings: 0

    MariaDB [centreon]> update cfg_ndo2db set db_user= "centreon";
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1 Changed: 1 Warnings: 0

    MariaDB [centreon]> update cfg_ndo2db set db_pass = "<password from /etc/centreon/centreon.conf.php file>";

    I thought that was a problem on password and tried to change user centreon to root and password to blank on configuration files, but with no chance

    How to check what's happening?

    Thanks you much

    References:
    https://forum.centreon.com/forum/ins...-comment-faire
    https://forum.centreon.com/forum/ins...an-to-centreon

    I'm creating a documentation on spanish to how to migrate FAN to CES3.3 here you have all the steps I have done

    ​​​​​​​########################################### ############################################

    <pre>
    [root@centreon3 ~]# /etc/init.d/centengine stop
    centengine stop: done [ FET ]
    </pre>

    Hacemos un dump de las bases de datos de centreon2

    <pre>
    [root@centreon2 migration_CES]# mysqldump centreon2 > 2016_07_18-centreon2.sql
    [root@centreon2 migration_CES]# mysqldump centreon2_storage > 2016_07_18-centreon2_storage.sql
    </pre>

    En centreon3 vaciamos las bases de datos y cargamos los datos de centreon2

    <pre>
    [root@centreon ~]# mysql
    Welcome to the MariaDB monitor. Commands end with ; or \g.
    Your MariaDB connection id is 578
    Server version: 5.5.35-MariaDB MariaDB Server

    Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    MariaDB [(none)]> drop database centreon;
    Query OK, 150 rows affected (0.40 sec)

    MariaDB [(none)]> drop database centreon_storage;
    Query OK, 43 rows affected (0.07 sec)

    MariaDB [(none)]> create database centreon;
    Query OK, 1 row affected (0.00 sec)

    MariaDB [(none)]> create database centreon_storage;
    Query OK, 1 row affected (0.00 sec)
    </pre>

    <pre>
    [root@centreon3 import_centreon2]# mysql centreon_storage < 2016_07_18-centreon2
    [root@centreon3 import_centreon2]# mysql centreon_storage < 2016_07_18-centreon2_storage.sql
    </pre>

    Ahora vamos a hacer que se actualice la base de datos, para ello copiamos el directorio ../installDir/install-loquesea a /usr/share/centreon/www/ (atención, si estás logueado, deslogueate!)

    <pre>
    [root@centreon www]# cp ../installDir/install-2.7.0-20160718_021956 .
    </pre>

    Seguimos las instrucciones y si aparece el mensaje "Database Error: Could not connect to database.
    Please contact your administrator.", es porque el acceso al ndo no es correcto, nos conectamos a la base de datos y hacemos lo siguiente

    <pre>
    [root@centreon www]# mysql

    MariaDB [(none)]> use centreon;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Database changed
    MariaDB [centreon]> update cfg_ndo2db set db_name = "centreon_status";
    Query OK, 1 row affected (0.01 sec)
    Rows matched: 1 Changed: 1 Warnings: 0

    MariaDB [centreon]> update cfg_ndo2db set db_user= "centreon";
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1 Changed: 1 Warnings: 0

    MariaDB [centreon]> update cfg_ndo2db set db_pass = "<password del fichero /etc/centreon/centreon.conf.php>";
    </pre>


Working...
X