Results 1 to 6 of 6

Thread: Upgrading from 2.11 to 3.1 error

  1. #1
    New user
    Join Date
    11-16-13.
    Posts
    2

    Frage Upgrading from 2.11 to 3.1 error

    Hi , i have replaced all the files carefully ,
    when i go to site/contao/install.php i see that the database is not updated .
    When i run update i got this error.
    I have seen a same post on the forum , and tried the solution , but it didnt worked for me.
    HTML Code:
    Fatal error: Uncaught exception Exception with message Query error: Can't DROP 'path'; check that column/key exists (ALTER TABLE `tl_files` DROP INDEX `path`) thrown in C:\Program Files\BitNami\apache2\htdocs\system\modules\core\library\Contao\Database\Statement.php on line 282
    #0 C:\Program Files\BitNami\apache2\htdocs\system\modules\core\library\Contao\Database.php(202): Contao\Database\Statement->query('ALTER TABLE `tl...')
    #1 C:\Program Files\BitNami\apache2\htdocs\system\modules\core\library\Contao\Database\Updater.php(468): Contao\Database->query('ALTER TABLE `tl...')
    #2 C:\Program Files\BitNami\apache2\htdocs\contao\install.php(986): Contao\Database\Updater->run31Update()
    #3 C:\Program Files\BitNami\apache2\htdocs\contao\install.php(544): InstallTool->update31()
    #4 C:\Program Files\BitNami\apache2\htdocs\contao\install.php(181): InstallTool->runDatabaseUpdates()
    #5 C:\Program Files\BitNami\apache2\htdocs\contao\install.php(1001): InstallTool->run()
    #6 {main}
    ^ here is the error
    i need to solve this ASAP , please anyone help me fix it.
    Thanks.

  2. #2
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default

    Hi shojib,

    try this:
    • Run the Contao Install Tool again
    • Deselect the checkbox for `tl_files` DROP INDEX `path`
    • Update all other database tables
    • At the very end, finally update the `tl_files` DROP INDEX `path`
    Contao Community Moderator
    → Support options

  3. #3
    New user
    Join Date
    09-19-11.
    Posts
    12

    Default

    Sorry in advace for hijacking, but it seems to me we have the same issue.

    Quote Originally Posted by xchs View Post
    Hi shojib,

    try this:
    • Run the Contao Install Tool again
    • Deselect the checkbox for `tl_files` DROP INDEX `path`
    • Update all other database tables
    • At the very end, finally update the `tl_files` DROP INDEX `path`
    Will not work, because DROP INDEX `path` can not be deselected. It's in the updater source code. I think the update procedure is faulty. I always run into problems when I try to update a 2.11 to 3.1 and it's always the same.

    The two lines giving me the headaches are these:

    Code:
    system\modules\core\library\Contao\Database\Updater.php, line 468:
    $this->Database->query("ALTER TABLE `tl_files` DROP INDEX `path`");
    
    same file line 470:
    $this->Database->query("ALTER TABLE `tl_files` ADD UNIQUE KEY `pid_name` (`pid`, `name`)");
    If I comment these lines out I don't get errors, but I don't get a finished successful update either, because:

    Code:
    same file line 472:
    // Remove the "mooType" field (triggers the version 3.1 update)
    $this->Database->query("ALTER TABLE `tl_content` DROP `mooType`");
    ...and the same time my database update list looks like this:

    Code:
    Add new columns	
    ALTER TABLE `tl_content` ADD `mooType` varchar(32) NOT NULL default '';
    
    Change existing columns
    ALTER TABLE `tl_member` CHANGE `autologin` `autologin` varchar(32) NULL default NULL;
    ALTER TABLE `tl_style` CHANGE `whitespace` `whitespace` char(1) NOT NULL default '';
    ALTER TABLE `tl_calendar_events` CHANGE `startTime` `startTime` int(10) unsigned NULL default NULL;
    ALTER TABLE `tl_calendar_events` CHANGE `endTime` `endTime` int(10) unsigned NULL default NULL;
    ALTER TABLE `tl_calendar_events` CHANGE `startDate` `startDate` int(10) unsigned NULL default NULL;	
    ALTER TABLE `tl_calendar_events` CHANGE `endDate` `endDate` int(10) unsigned NULL default NULL;
    
    Drop existing columns
    ALTER TABLE `tl_files` DROP INDEX `pid_name`;
    As you can see, first it drops the field, then it wants to add the field and it's a never ending cycle. I didn't delve any deeper to other fields, but the mooType one stuck to my eye.

  4. #4
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default

    Have you tried to check files with Contao check?

    Latest release is 7.5: https://github.com/contao/check/releases
    --
    Takahiro Kambe

  5. #5
    New user
    Join Date
    09-19-11.
    Posts
    12

    Default

    This is a solution that worked for me:

    The problem is caused by certain 2.x module SQL config files. For some reason the v3 update still tries to parse them and they mess up the updating procedure. Gone are the days when you could simply overwrite old the Contao codebase with a new one when updating. Now when updating from 2.11 to 3, old unneeded and deprecated files need to be deleted. I bluntly deleted the entire system folder. Then I overwrote the remaining contents of my installation folder with the v3 files and ran the update. It was a success.

    Please note that if you have installed any extensions, you should backup them first, though I think you can just run update/repair for them too.

    The Contao manual explains the most vital part of the update process vaguely:

    Synchronizing files

    To synchronize a Contao installation, you can either use the Unix diff utility or an FTP program. Unix utilities are typically used by server administrators only, so they will not be explained here. To synchronize files via FTP, open WinSCP and connect to the server. Backup the files mentioned above and then navigate to the Contao directory and click the "Synchronize files" button.
    This section is easy to overlook and doesn't make any sense to anybody who is not experienced with Unix systems. Also suitable utilities for Windows are hard to find if you don't know what you are looking for. Also the screenshot is lazily in German only, too small and not zoomable.

  6. #6
    User
    Join Date
    12-13-14.
    Posts
    33

    Default

    Quote Originally Posted by Triskal View Post
    This is a solution that worked for me:

    The problem is caused by certain 2.x module SQL config files. For some reason the v3 update still tries to parse them and they mess up the updating procedure. Gone are the days when you could simply overwrite old the Contao codebase with a new one when updating. Now when updating from 2.11 to 3, old unneeded and deprecated files need to be deleted. I bluntly deleted the entire system folder. Then I overwrote the remaining contents of my installation folder with the v3 files and ran the update. It was a success.

    Please note that if you have installed any extensions, you should backup them first, though I think you can just run update/repair for them too.

    The Contao manual explains the most vital part of the update process vaguely:

    This section is easy to overlook and doesn't make any sense to anybody who is not experienced with Unix systems. Also suitable utilities for Windows are hard to find if you don't know what you are looking for. Also the screenshot is lazily in German only, too small and not zoomable.
    you mean you ran the installation tool again?
    wonder if i can just copy&replace the localhost files if i want to test if the manual update would work at all?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •