Author Topic: Migration script is not using the table prefix found in config.php  (Read 8726 times)

interfaSys

  • Guest
The migration script fails because the table prefix is hardcoded in some (all?) of the commands. It should use the one found in config.php.

franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: Migration script is not using the table prefix found in config.php
« Reply #1 on: March 26, 2012, 02:56:17 pm »
That's correct! Please check this thread out:
http://forums.fengoffice.com/index.php?topic=14846.0

Greetings,
Francisco
Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!

interfaSys

  • Guest
Re: Migration script is not using the table prefix found in config.php
« Reply #2 on: March 27, 2012, 08:27:37 am »
This is a slightly different problem. I'm not talking about post-upgrade changes.
The migration script will just not run if the table prefix for the current installation is not og_. Since the configuration file contains the current prefix. The migration script should use that to run the queries.

Bithunter

  • Freshman
  • *
  • Posts: 11
    • View Profile
Re: Migration script is not using the table prefix found in config.php
« Reply #3 on: March 27, 2012, 09:34:58 am »
I´m facing the same problem. I was a OpenGoo user since the earlier versions, and I have a exclusive database for it. I have no prefix, but \public\upgrade\templates\db_migration\2_0_asado.php is hardcoded with og_ prefix. It should use instead the prefix defined in config.php (none, in my case).

Regards

Henry

  • Full Member
  • ***
  • Posts: 159
    • View Profile
Re: Migration script is not using the table prefix found in config.php
« Reply #4 on: March 27, 2012, 02:33:26 pm »
hi,

if you need a quick solution you can run this little script.
It renames alle tables in your Database to og_*
If it was successful you can run the upgrade.

Code: [Select]
<?php 
$host 
'localhost';
$database 'database_name';
$db_user 'user';
$db_user_pw 'password';

$db = new mysqli($host,$db_user,$db_user_pw,$database);
$result $db->query('SHOW tables;');
$suchmuster '/^og_/';
 while (
$row $result->fetch_row()) {
        if (!
preg_match($suchmuster$row[0])){
$db->query('RENAME TABLE `'.$database.'`.`'.$row[0].'` TO `'.$database.'`.`og_'.$row[0].'` ;');
}
    }

?>


Henry

seraphim

  • Freshman
  • *
  • Posts: 15
    • View Profile
Re: Migration script is not using the table prefix found in config.php
« Reply #5 on: March 28, 2012, 04:55:18 am »
I tried to run this migration script after renaming again, but it produces no output.

should this be normal??

supadoctor

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Email
Re: Migration script is not using the table prefix found in config.php
« Reply #6 on: March 29, 2012, 08:56:29 am »
Strange...but my users table after upgrading still with og_prefix and now FO 2.0 can't file fo_users...  ???

supadoctor

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Email
Re: Migration script is not using the table prefix found in config.php
« Reply #7 on: March 30, 2012, 02:14:33 am »
My attempts to upgrade 1.7.5 to 2.0.0.8 are failed... Fortunately I do not lost my DB! :)
To FO STUFF - you should improve upgrade script and process because many people use 1.7.x version (for me, I'm on 1.7.x more than 1,5 year) and without robust and safe upgrade procedure new version can stay unpopular and widely used  :-[

mariaczi

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Migration script is not using the table prefix found in config.php
« Reply #8 on: March 30, 2012, 07:27:36 am »
Upgrade script not correctly update prefix_timeslots table. After upgrade new table didn't have "id' column.

bleeuwen

  • Freshman
  • *
  • Posts: 26
    • View Profile
    • Email
Re: Migration script is not using the table prefix found in config.php
« Reply #9 on: October 18, 2012, 07:28:13 am »
Great post!!!
My migration from 1.7.5 to 2.2 failed.
With he given script I could easily give the old table the prefix 'og_'  so the first step of the migration was Succesfull.
THANKS for the script !!!! :)

After thsi I did the following:
- run public/upgrade/complete_migration.php (perform it several times is advizd)
- overwrite the  init.php and version.php with the new ones

Than all is OK

(If you do not overwrite the init.php file, selecting a special workspace does nog lead to filtering of files).
« Last Edit: October 19, 2012, 04:35:08 pm by bleeuwen »

Baveskara

  • Hero Member
  • *****
  • Posts: 648
    • ICQ Messenger - 365673748
    • Yahoo Instant Messenger - cialis and beer
    • View Profile
    • generic cialis 5 mg from india
    • Email
cialis 5mg for what
« Reply #10 on: July 27, 2022, 02:39:31 pm »
buy priligy australia For people being referred back to primary care
« Last Edit: December 18, 2022, 11:48:54 am by Baveskara »