version upgrade

Discussion in 'Installation and Updates' started by super, Jul 6, 2006.

  1. super

    super New Member

    how to upgrade esyndicat from 1.4 to 1.5?
    Thanks!
  2. Sergey Ten

    Sergey Ten <b>eSyndiCat Lead Developer</b>

    Hello super,

    H-m-m... Do you use free or pro version of the eSyndiCat?
  3. super

    super New Member

    hello sergen,
    i am used free version .
  4. Nick Collins

    Nick Collins Guest

    Hello super. Unfortunately we have no sql upgrade from v1.4 to v1.5. I would advice you to install script from the beginning and then import data of some tables (basically it is "dir_categories" and "dir_links") from old DB to new. After migration of data empty your "dir_flat_structure" table and run "convert_flat.php" file which build your flat structure form the beginning (you can find content of this file in our forums). Make sure that your ROOT category has ID=0. Edit your dir_sequences table (increase value of links and categories up to actual number of links and categories). That's all.
  5. Rob

    Rob New Member

    help please

    Ive followed your upgrade instructions and have come across the following problems.

    1. Which is the ROOT category, and where can i find it so i can change its id to 0

    2. Which field do you make the change in to set the value of links and categories in dir_sequences table.


    Thanks
  6. Sergey Ten

    Sergey Ten <b>eSyndiCat Lead Developer</b>

    Hello Rob,

    #1
    The ROOT category is in the table "dir_categories".

    This query add in your database ROOT category for version 1.2
    Code:
    INSERT INTO `dir12_categories` (`id`, `id_editor`, `id_parent`, `title`, `description`, `status`, `meta_description`, `meta_keywords`, `path`, `order`, `locked`, `unique_tpl`, `level`, `num_cols`, `neighbour`) VALUES (0, 0, -1, 'ROOT', '', 'active', '', '', '', 0, '0', '0', 0, NULL, 0);
    
    #2
    You have to create php file with such code and run it on your server.

    PHP:
    <?php

    require_once('includes/config.inc.php');
    require_once(
    'classes/DirDb.php');

    /** use database class **/
    $gDb = new Database();

    $gDb->mDbhost $gDirConfig['dbhost'];
    $gDb->mDbname $gDirConfig['dbname'];
    $gDb->mDbuser $gDirConfig['dbuser'];
    $gDb->mDbpwd $gDirConfig['dbpwd'];
    $gDb->connect();


    /** get max id for links **/
    $sql "SELECT MAX(`id`) FROM `{$gDirConfig['prefix']}links`;";
    $id_links $gDb->getOne($sql);

    /** get max id for categories **/
    $sql "SELECT MAX(`id`) FROM `{$gDirConfig['prefix']}categories`;";
    $id_categories $gDb->getOne($sql);

    /** get max id for editors **/
    $sql "SELECT MAX(`id`) FROM `{$gDirConfig['prefix']}editors`;";
    $id_editors $gDb->getOne($sql);

    /** get max id for admins **/
    $sql "SELECT MAX(`id`) FROM `{$gDirConfig['prefix']}admins`;";
    $id_admins $gDb->getOne($sql);


    $id_links = (empty($id_links)) ? $id_links;
    $id_categories = (empty($id_categories)) ? $id_categories;
    $id_editors = (empty($id_editors)) ? $id_editors;
    $id_admins = (empty($id_admins)) ? $id_admins;


    /** update information for links **/
    $sql "UPDATE `{$gDirConfig['prefix']}sequences` SET `links`='{$id_links}';";
    $gDb->query($sql);

    /** update information for categories **/
    $sql "UPDATE `{$gDirConfig['prefix']}sequences` SET `categories`='{$id_categories}';";
    $gDb->query($sql);

    /** update information for editors **/
    $sql "UPDATE `{$gDirConfig['prefix']}sequences` SET `editors`='{$id_editors}';";
    $gDb->query($sql);

    /** update information for admins **/
    $sql "UPDATE `{$gDirConfig['prefix']}sequences` SET `admins`='{$id_admins}';";
    $gDb->query($sql);

    ?>
    This is script which will update information in "dir_sequences" table.

Share This Page