Update SI from an old version

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2003

    Hello,
    Thank you Fearless for the work. I am used to work with uwamp, php 7.2.7, mysql 5.7.11 and the SI Version: 2019.2.31 — 20210211. I get errors to update with newer verion of SI and my bill design is broken as I did the last update version.
    Wht shall I have to do ?
    I enclose a dump of the sql because I need a bit help.
    Regards

    #2013
    fearless359
    Keymaster

    Via phpMyAdmin, access the si_invoice_items table and execute the following SQL command:

    ALTER TABLE si_invoice_items MODIFY id INT(11) UNSIGNED NOT NULL;
    

    Had to dig, but issue is that the invoice_item_id field in the si_invoice_item_tax table is configured differently than the id field in the si_invoice_items table. This command corrects the issue.

    • This reply was modified 6 months, 2 weeks ago by fearless359.
    • This reply was modified 6 months, 2 weeks ago by fearless359.
    #2017

    Hello,
    Thanks for the tip and the time you took to have a look. Unfortunatly as I copy paste the sql command to alter table si_invoice_items MySql returns an empty result where no line needs to be altered.
    Need a bit more help please,
    Regards
    Stéphane

    #2018
    fearless359
    Keymaster

    In the schema you attached, the following is the id settings in si_invoice_items:

    CREATE TABLE si_invoice_items (
      id int(10) NOT NULL AUTO_INCREMENT,
    

    It should be:

    CREATE TABLE si_invoice_items (
      id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    

    If the table is set correctly, then the update process should complete as it did once I made the change. Note, you can change the field setting manually in phpMyAdmin by selecting the Change option on the id column under the Structure tab when si_invoice_items is selected.

    • This reply was modified 6 months, 2 weeks ago by fearless359.
    #2024

    Hi,
    I have tried your tips but I could not achieve to a good updated version 🙁 I am not good enough. Well I have tried to install SI 2023 with Wamp 64. It did well. It has told me updates need to be done from the #330 or #331 but sql updater did not be able to do these updates.
    So I have begun with the 2023 version but I am frustrated I could not be able to solve my problems even if you have taken precious time to help.
    I have uploaded the last sql version enclosed to this message. More over it says to check error.log but I do not know where the file is situated.
    Well…
    Regards
    Stéphane

    Attachments:
    #2026

    [UPDATE & GOOD NEWS]

    I did a new install from the 2019.2 version in wamp 64. I guess my uwamp was a bit old. I have imported my database from the previous install, everything did well. Then I have updated with 2023 version and have applied the sql patch. Several errors due to foreign keys in the invoice_item_tax table related to invoice_items table have been solved as I have deleted them. Made the update, everything is well and I have the 2023 version ! The design is not broken anymore.

    Regards

    Stéphane

    #2028
    RRowley
    Participant

    Great news. Thank you for letting me know.

    #2029

    Hi,
    I am used to create the bills with the SI2023 version, php 8.2, mysql 8
    I am back with a new bug I can not solve. I do not really understand the meaning of this error message enclosed in my png file.
    What shall I have to do please ?
    Regards
    Stéphane

    Attachments:
    #2032
    RRowley
    Participant

    The error appears to complain that there is an attempt to add and si_invoice_items record with a duplicate value of 0 for its primary key. The primary key is (should be) the ID field. This field could only be assigned 0 if it does not have the auto increment setting on. User phpMyAdmin to verify this. There are two issues to correct. One is that there is now a record in that table with a 0 value for its ID field. That is a problem. I suggest you find which invoice this is for and delete it. If you don’t find a record with a 0 ID value, it was probably created for the invoice you are adding, say for the first invoice item and then it got an error on the second. Once you’ve cleared up the 0 ID issue, you can set the auto increment setting on the table. This can be done in phpMyAdmin. If you had to delete and invoice, add it back now. Make note of the original invoice number to reference it to the new number assigned to it for your records. Once you’ve taken care of any deleted invoice, you can add the invoice you were trying to add when this error occurred. All should be OK at this point.

    #2033

    Hi,
    Thanks for the tip. I have found 0 ID and I have issued it manually. I have tried to check the option AI in the table si_invoice_items column ID. I can not. SQL error message says “Cannot change column ‘id’: used in a foreign key constraint ‘si_invoice_item_tax_ibfk_2’ of table si_invoice_item_tax
    Well, I could not find this named column in the table and I do not know waht to do after this new message.
    Regards,
    Stéphane

    #2034
    RRowley
    Participant

    The issue is that the si_invoice_item_tax file has a foreign key set on the ID field of the si_invoice_items table. You need to make note of the foreign key settings and then delete the foreign key. Next add the auto increment to si_invoice_items ID field. Finally, add the foreign key back on the si_invoice_item_tax table.

    #2035

    Hi,
    Thanks a lot for your help. I have followed your advices and everything is ok now.
    Bye then from France
    Stéphane

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.