I'm trying to work out what is the best way of doing an upgrade script.
I have looked at other scripts like phpbb and I think the problem is that people modifiy opencart more than they would a forum script.
We need a way of reporting chnages to the user before they do an update.
What about the db. Does mysql have functionality to change alter its structure to match another one?
I really don;t want to waste time writing complex upgrade scripts for each release.
Any one have any ideas?
I have looked at other scripts like phpbb and I think the problem is that people modifiy opencart more than they would a forum script.
We need a way of reporting chnages to the user before they do an update.
What about the db. Does mysql have functionality to change alter its structure to match another one?
I really don;t want to waste time writing complex upgrade scripts for each release.
Any one have any ideas?
OpenCart®
Project Owner & Developer.
I'm not sure about the best way to create an upgrade script, but i do know that most of the problems people have when upgrading (in particular to 1.3.0) was because of the database.
Maybe it would be a good idea to have a more advanced backup script where you can specify which tables to keep, and which to not backup. Is it possible to restore a database table without clearing it beforehand?
Maybe then, in the upgrade.txt, you could tell people for example to not backup a certain aspect in the backup manager, so we know not to backup for example the image size section of the settings table, so that when we restore our database using the backup manager, it won't overwrite the image size settings, so we wouldn't get the errors we got when we overwrited the image settings.
I don't even know if this is possible - it's just an idea that could make upgrading have less errors.
Maybe it would be a good idea to have a more advanced backup script where you can specify which tables to keep, and which to not backup. Is it possible to restore a database table without clearing it beforehand?
Maybe then, in the upgrade.txt, you could tell people for example to not backup a certain aspect in the backup manager, so we know not to backup for example the image size section of the settings table, so that when we restore our database using the backup manager, it won't overwrite the image size settings, so we wouldn't get the errors we got when we overwrited the image settings.
I don't even know if this is possible - it's just an idea that could make upgrading have less errors.
Hi Daniel,
You can mod mysql tables on the fly if you wish:
Load the fields to do a compare:
You could do a pre install / upgrade check by comparing the files one by one and writing out a text file of the changes / differences so people can do the mods etc...
Hope this helps...
Phil.
You can mod mysql tables on the fly if you wish:
Code: Select all
mysql_query("ALTER TABLE orders ADD order_text CHAR(3)");
Code: Select all
mysql_query("ALTER TABLE orders CHANGE order_text order_text VARCHAR(15)");
Code: Select all
mysql_query("ALTER TABLE orders DROP order_text");
Code: Select all
mysql_query("SHOW COLUMNS FROM orders");
Hope this helps...
Phil.
Daniel take a look at phorum.org code they use "hooks" whit hooks you can add more and more module but core code is still intact so you can upgrade whit no truble also take a look at upgrade script version 3 to 5
Wordpress uses a system that automatically updates itself by creating the files it needs (php pages creating php pages) and phpbb although it does not do it automatically has a very good system.
I'm sure an update system similarr to phpbb could be accomplished, lots of people know how to modify the core phpbb from how it works and create modifications around the existing system. Maybe you could get people from the phpbb community to help you replicate that?
I'm sure an update system similarr to phpbb could be accomplished, lots of people know how to modify the core phpbb from how it works and create modifications around the existing system. Maybe you could get people from the phpbb community to help you replicate that?
MySQL provides the 'DESCRIBE table-name' statement for retrieving all the information of a table, including stuff like the Field, Type, Null, Key, Default, Extra. Do this for both the old and new version of the database table, compare the 2 result sets, and if the old table has any additional fields added by the store owner or by a contribution, it will detect it. You can then use the normal ALTER TABLE statement for the new table to insert the additional field columns.
In fact it should be possible to provide a fairly generic SQL upgrade script with this. Just make sure you haven't renamed field columns between the old and new version of a DB table.
In fact it should be possible to provide a fairly generic SQL upgrade script with this. Just make sure you haven't renamed field columns between the old and new version of a DB table.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Who is online
Users browsing this forum: No registered users and 2 guests