Upgrade from v2.0.x to 5.0.x

Important notice - upgrading News StyList from version 2.0.x or earlier to version 4.0.x,5.0.x or higher causes a loss of configuration. This happens moving news system from 10.x to 11.x.

To solve the problem it is necessary to proceed in this way, before launching the Updater from the news system:

  • backup your data, dump the whole database or the table tt_content
  • update news system to the new version (i.e. from v 10.x to 11.3+)
  • do not run the updater of news system
  • update News StyList version 2.0.x or previous to 5.0.x
  • download the php needed to update your tt_content table (or copy/paste the code below)
  • configure the Updater (insert dbname, user, password)
  • run the Updater
  • now under Admin Tools > Upgrade, run the upgrade process of news system

If you want, you can copy and paste the following code and run it:

<?php

# php init and config
error_reporting(E_ALL & ~(E_STRICT|E_NOTICE));
ini_set('memory_limit', '512M');

# database  data // set here username,password,dbname
$typo_db_username = '';  
$typo_db_password = '';     
$typo_db_host = 'localhost';    
$typo_db = '';   // dbname 

# connection to DB or die
if ($db->connect_errno) {
     echo "DB connection error - database name  " . $typo_d . ", exit" . __LINE__ . "\n\r";
     exit;
}

# init
$db = new mysqli($typo_db_host,$typo_db_username,$typo_db_password,$typo_db);

# init counter
$x = 0;

# sql mquery
$sql = "UPDATE tt_content SET pi_flexform = REPLACE(pi_flexform,'<sheet index=\"extraEntry\">','<sheet index=\"newsstylist\">') WHERE list_type='news_pi1' ";
if($result = $db->query($sql)) {
        $x++;
}

# sql mquery
$sql = "UPDATE tt_content SET pi_flexform = REPLACE(pi_flexform,'<sheet index=\"extraEntry1\">','<sheet index=\"swiperslider\">') WHERE list_type='news_pi1' ";
if($result = $db->query($sql)) {
        $x++;
}

$result = $db->query($sql);

# close db connection
$db->close;

if($x > 1) {
        echo  "Flexform updated\n\r";
} else {
        echo "FlexForm not updated.\n\r";
}


?>