ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

database error during update

February 22, 2012 9:57am

Subscribe [3]
  • #1 / Feb 22, 2012 9:57am

    Willem de Boer

    142 posts

    This question may be related to a resolved thread.

    Updating now from 1.6.8 to 2.4 and got the following Error:

    A Database Error Occurred
    Error Number: 1091

    Can’t DROP ‘code’; check that column/key exists

    ALTER TABLE `exp_ip2nation_countries` DROP KEY `code`

    Filename: /var/clients/client4/web3/web/system/expressionengine/modules/ip_to_nation/upd.ip_to_nation.php

    Line Number: 182

    i will remove now the ip2nation module. check if that is helping.

     

  • #2 / Feb 22, 2012 10:01am

    Willem de Boer

    142 posts

    That helps, but the following error is this:

    A Database Error Occurred
    Error Number: 1054

    Unknown column ‘wm_x_offset’ in ‘exp_file_watermarks’

    ALTER TABLE `exp_file_watermarks` CHANGE `wm_x_offset` `wm_hor_offset` int

    Filename: updates/ud_240.php

    Line Number: 83

  • #3 / Feb 22, 2012 10:05am

    Willem de Boer

    142 posts

    I only have wm_hor_offset and wm_vrt_offset

  • #4 / Feb 22, 2012 10:12am

    Willem de Boer

    142 posts

    changed both in wm_x_offset and wm_y_offset, but still got the same error.

  • #5 / Feb 22, 2012 10:14am

    Willem de Boer

    142 posts

    Changed it again, now i can go further.

  • #6 / Feb 22, 2012 10:16am

    Willem de Boer

    142 posts

    Next Error

    A Database Error Occurred
    Error Number: 1060

    Duplicate column name ‘credit’

    ALTER TABLE `exp_files` ADD `credit` varchar(255)

    Filename: updates/ud_240.php

    Line Number: 137

     

    I’ll remove that table.

  • #7 / Feb 22, 2012 10:45am

    Willem de Boer

    142 posts

    Again the wm_x_offset and wm_y_offset

    after that

    Location error in exp_files

    after that

    Again the wm_x_offset and wm_y_offset (grrrrrrrrrrrrrr)

    AFter that

    Credit error in exp_files

    after that

    Again the wm_x_offset and wm_y_offset (grrrrrrrrrrrrrrrrrrrrr)

    after that

    A Database Error Occurred
    Error Number: 1054

    Unknown column ‘caption’ in ‘exp_files’

    ALTER TABLE `exp_files` CHANGE `caption` `description` text

    Filename: updates/ud_240.php

    Line Number: 148

  • #8 / Feb 22, 2012 11:24am

    Willem de Boer

    142 posts

    Ok, this will be a long evening.

    All the fields in exp_files doesn’t exist, and after i create, delete or rename a field, i get the x and y offset error.

    But hopefully in an hour and all the database errors further, i am upgraded, hopefully.
    Maybe some-one of the team can help me with this problem. In the meantime i follow all the database instructions and hope to get further in the update process.

  • #9 / Feb 22, 2012 12:27pm

    Willem de Boer

    142 posts

    Got it…

    add and removed all the tables, that the updatescript could run this:

    * Update Files Table
      *
      * Adds extra metadata fields to file table, and deletes old custom fields
      *
      * @return void
      */
     private function _update_files_table()
     {
      $this->EE->dbforge->add_column(
       'files',
       array(
        'credit' => array(
         'type'   => 'varchar',
         'constraint' => 255
        ),
        'location' => array(
         'type'   => 'varchar',
         'constraint' => 255
        )
       )
      );
      
      // Rename "caption" field to "description"
      $this->EE->dbforge->modify_column(
       'files',
       array(
        'caption' => array(
         'name' => 'description',
         'type' => 'text'
        ),
       )
      );
      
      // Drop the 6 custom fields
      for ($i = 1; $i < 7; $i++)
      { 
       $this->EE->dbforge->drop_column('files', 'field_'.$i);
       $this->EE->dbforge->drop_column('files', 'field_'.$i.'_fmt');
      }
      
      // Drop 'metadata' and 'status' fields
      $this->EE->dbforge->drop_column('files', 'metadata');
      $this->EE->dbforge->drop_column('files', 'status');
     }

    from the updatescript

  • #10 / Feb 23, 2012 1:04pm

    Shane Eckert

    7174 posts

    Hello Willem de Boer,

    That was quite the epic adventure there. Most likely the update did not complete and that is why you had to mess with the database.

    So how are things now? Are you up and running?

    Let me know!

    Cheers,

  • #11 / Feb 25, 2012 10:24am

    Willem de Boer

    142 posts

    Hi Shane,

    It was..

    Yes, i read the update240 script, looked which tables are changed. renamed all that tables to the old names, and run the updatescript once again, that was the trick..

    Case closed, but maybe you can have a look if the update is working well from 1.6.8 to 2.4.

  • #12 / Feb 27, 2012 1:09pm

    Shane Eckert

    7174 posts

    Hi Willem de Boer,

    That’s great news. I am glad to hear this workd.

    If you need anything else, please let me know!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases