Post by Nsaneone » Thu Jan 13, 2022 12:32 am

Good Afternoon All. I am attempting to upgrade our Opencart 1.5.6 to 3.0.3.8. However during the upgrade I observe the following error

Error Code(0): Error: Incorrect DATETIME value: ''
Error No: 1525
UPDATE `oc_order_recurring` SET `date_added` = `created` WHERE `date_added` IS NULL or `date_added` = ''

Reading a few topics here, I checked to see if I could remove the NO_ZERO_DATE session option in the mysqli connector. But realised in this version that has already been done. Is this because of the structure of the database doesnt allow NULL values, but the upgraded version does? Any advice is appreciated.
Last edited by Nsaneone on Fri Jan 14, 2022 4:06 am, edited 1 time in total.

Newbie

Posts

Joined
Thu Jan 13, 2022 12:24 am

Post by by mona » Thu Jan 13, 2022 1:17 am

Good Afternoon to you also ;D

You should probably follow this very good advice
viewtopic.php?f=181&t=226916

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by Nsaneone » Thu Jan 13, 2022 2:17 am

Thank you kindly. I thought in the back of my mind I may need to setup 3.0.3.8 as standalone and then migrate the database. I was allured by the possibility the upgrade would save time :) but I think that thought was false.

Thanks again :)

Newbie

Posts

Joined
Thu Jan 13, 2022 12:24 am

Post by johnp » Thu Jan 13, 2022 3:18 am

I've upgraded a few 1.5.6.4/5 sites to V3. Now I'd probably do a clean install and export/import the original site data. :)

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by Nsaneone » Thu Jan 13, 2022 3:28 am

Thank you for that information John. Any clues on the error I'm facing? I was speculating that even though the mysql session allows ZERO values for the date, it's the database table itself which doesn't allow NULL or 0 values. I guess I will know more once I have them side by side and can compare

Newbie

Posts

Joined
Thu Jan 13, 2022 12:24 am

Post by johnp » Thu Jan 13, 2022 3:40 am

If you do a fresh V3 install with a clean database that shouldn't be a problem. Just move the required data over using an export/import extension. I usually move over product and customer data and reinstall any extensions and themes etc. using their OC3 versions or the nearest you can get to them.

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by johnp » Thu Jan 13, 2022 4:01 am

I'm sure you've already got your 1.5 site running on PHP 7.4. If not, get that done before setting up your clean V3. :)

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by straightlight » Thu Jan 13, 2022 9:18 am

Nsaneone wrote:
Thu Jan 13, 2022 12:32 am
Good Afternoon All. I am attempting to upgrade our Opencart 1.5.6 to 3.0.3.8. However during the upgrade I observe the following error

Error Code(0): Error: Incorrect DATETIME value: ''
Error No: 1525
UPDATE `oc_order_recurring` SET `date_added` = `created` WHERE `date_added` IS NULL or `date_added` = ''

Reading a few topics here, I checked to see if I could remove the NO_ZERO_DATE session option in the mysqli connector. But realised in this version that has already been done. Is this because of the structure of the database doesnt allow NULL values, but the upgraded version does? Any advice is appreciated.
`created` cannot contain reversed quotes. The database structures no longer allows the DATETIME period to be defined as 0s be default while the upgraded versions of OC have a workaround for it.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Thu Jan 13, 2022 7:15 pm

straightlight wrote:
Thu Jan 13, 2022 9:18 am
`created` cannot contain reversed quotes. The database structures no longer allows the DATETIME period to be defined as 0s be default while the upgraded versions of OC have a workaround for it.
`created` with the backticks would be fine, as it's a table name. The issue is '' is not a valid date even with NO_ZERO_DATE removed from sql_mode. The query would need to be changed to.

Code: Select all

UPDATE `oc_order_recurring` SET `date_added` = [b]`created`[/b] WHERE `date_added` IS NULL or `date_added` = '0000-00-00' 

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Nsaneone » Fri Jan 14, 2022 3:25 am

Thank you all greatly for your support. I am having much more luck setting up Opencart 3.0.3.8 from stratch and importing the data from the 1.5.6 database ( had to add a few columns to the new structure).

I noticed that in our 1.5.6 a few modifications were made to call custom PHP scripts in the tpl files. But on the new version it uses twig which I understand doesn't support PHP. Any guidance on how I could accomplish the same/similar for twig files? Apologies this question may not be suitable for this particular forum

Newbie

Posts

Joined
Thu Jan 13, 2022 12:24 am

Post by by mona » Fri Jan 14, 2022 3:33 am

Great. Now that you have accomplished this and well done .. It is customary to add [SOLVED] to the beginning of your title post.

Regarding tpl written in php and twig written in twig
There are other changes which will prevent many of you extensions from working.

First you go to your download page in the marketplace - If you are in luck you will find a version for OC3
Second it is unlikely anyone will convert them for free although there are some online services available it is not just about converting the tpl to twig.
It is more than likely you will be sent to the commercial section. However you are welcome to try to post in a new topic.
Help need to convert some OC1.5.6 extensions to OC3.0.3.8

maybe post in both places

Have a great day or night

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by Nsaneone » Fri Jan 14, 2022 4:48 am

Thank you for your advice Mona. The code in question wasn't from an extension but written by the previous developer who worked on the system. I was hoping for examples on how twig format worked in comparison to the tpl format. I was able to find the following, which I hope assists anyone searching for answers.

viewtopic.php?t=212438

Newbie

Posts

Joined
Thu Jan 13, 2022 12:24 am

Post by JBWebDev10 » Thu Feb 24, 2022 1:22 pm

I ran into this issue upgrading from 1.5.x to 3.0.3.8, although this issue occurs on recurring orders as well as recurring transactions, I ended up working around by simply going into the /install/upgrade/1001.php and just commenting out any lines around order_recurring and was able to proceed with upgrade.

Also had to update /1005.php for recurring_transaction & /1009.php for DROP affiliate_activity table.

Again, none of these tables were relevant to my build, but was able to get everything done, hopefully helps someone out there.

Newbie

Posts

Joined
Mon Sep 09, 2019 8:37 pm

Post by xxvirusxx » Thu Feb 24, 2022 2:40 pm

JBWebDev10 wrote:
Thu Feb 24, 2022 1:22 pm
for DROP affiliate_activity table.
Because is a bug...

Code: Select all

			if (!$affiliate_query->num_rows) {
				$this->db->query("DROP TABLE `" . DB_PREFIX . "affiliate_activity`");
			}
And should be

Code: Select all

			if ($affiliate_query->num_rows) {
				$this->db->query("DROP TABLE `" . DB_PREFIX . "affiliate_activity`");
			}

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by straightlight » Fri Feb 25, 2022 1:04 am

ADD Creative wrote:
Thu Jan 13, 2022 7:15 pm
straightlight wrote:
Thu Jan 13, 2022 9:18 am
`created` cannot contain reversed quotes. The database structures no longer allows the DATETIME period to be defined as 0s be default while the upgraded versions of OC have a workaround for it.
`created` with the backticks would be fine, as it's a table name. The issue is '' is not a valid date even with NO_ZERO_DATE removed from sql_mode. The query would need to be changed to.

Code: Select all

UPDATE `oc_order_recurring` SET `date_added` = [b]`created`[/b] WHERE `date_added` IS NULL or `date_added` = '0000-00-00' 
If there isn't a commit on Github Opencart repository about this already, one may need to be created if the case.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 75 guests