Page 1 of 1

Upgrade OC 1.5.5.1 To 3.0.1.2

Posted: Thu Nov 02, 2017 4:55 pm
by blackarch
I using OC Version 1.5.5.1 and I tried upgrade to 3.0.1.2, since I read version 3.0.0.0 have error/bug (but I forget where did i read it).
Current PHP version: 5.6.31, I following from here http://docs.opencart.com/upgrading/ for upgrade version
What i did :
1. Set backup current mysql/OC
2. Turn off the module (actually I not use any single module)
3. Upload the file to website (front & back end).
4. Set the admin/config & config.

I got 4 Error in my front end website :
1. Notice: Use of undefined constant DIR_STORAGE - assumed 'DIR_STORAGE' in /home/website/website.com/system/startup.php on line 70
2. (This loop 7 - 10) Notice: Use of undefined constant DIR_MODIFICATION - assumed 'DIR_MODIFICATION' in bla bla bla
3. Notice: Use of undefined constant DB_PORT - assumed 'DB_PORT' in /home/website/website.com/system/config/catalog.php on line 16
4. Fatal error: Uncaught exception 'Exception' with message 'Error: Could not load database adaptor mmysqli!' in /home/website/website.com/system/library/db.php .bla bla bla

To fix it :
1-4. Change both config, follow this link https://github.com/opencart/opencart/issues/5688 (Same Case)
Note :
1. Actually this //DIR DIR_DATABASE is gone(in 3.0.1.2)(Both config) ? should i keep it(old version)/remove it from (Both Config ?) ??? ,
2. Front-end Config : Change the the url 'DIR_CATALOG'
3. It's okay for change (old) define('DB_DRIVER', 'mmysqli'); to (new) define('DB_DRIVER', 'mysqli'); ???
4. Both Config : I still keep the define('DB_PREFIX', ''); since change to define('DB_PREFIX', 'oc_'); got error :-X like this : Fatal error: Uncaught exception 'Exception' with message 'Error: Table 'website.oc_session' doesn't exist bla bla bla

Next the new error :
Fatal error: Uncaught exception 'Exception' with message 'Error: Table 'website_db.session' doesn't exist<br />Error No: 1146<br />SELECT `data` FROM `session` WHERE session_id = bla bla bla

I Add new table in my DB :

Code: Select all

CREATE TABLE `session` (
  `session_id` varchar(32) NOT NULL,
  `data` text NOT NULL,
  `expire` datetime NOT NULL,
  PRIMARY KEY (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
Current Error Admin :
1. Warning: require_once(/system/startup.php): failed to open stream: No such file or directory in /home/website/website.com/admin/index.php on line 17
2. Fatal error: require_once(): Failed opening required '/system/startup.php' (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in /home/website/website.com/admin/index.php on line 17

Current Error Website :
1. Fatal error: Uncaught exception 'Exception' with message 'Error: Table 'website.translation' doesn't exist<br />Error No: 1146<br />SELECT * FROM translation WHERE store_id = '0' AND language_id = '0' AND (route = 'engb' OR route = '')' in /home/website/website.com/system/library/db/mysqli.php:40 Stack trace: #0 /home/website/website.com/system/library/db.php(16): DB\MySQLi->query('SELECT * FROM t...', Array) #1 /home/website/website.com/catalog/model/design/translation.php(6): DB->query('SELECT * FROM t...') #2 [internal function]: ModelDesignTranslation->getTranslations('engb') #3 /home/website/website.com/system/engine/loader.php(185): call_user_func_array(Array, Array) #4 [internal function]: Loader->{closure}(Array, Array) #5 /home/website/website.com/system/engine/proxy.php(25): call_user_func_array(Object(Closure), Array) #6 /home/website/website.com/catalog/controller/event/translation.php(6): Proxy->__call('getTranslations', Array) #7 /home/website/website.com/catalo in /home/website/website.com/system/library/db/mysqli.php on line 40

I need to build table for translation, but idk the structure table. :'(
Now I stuck with this error, did I make mistake from the upgrade? ??? , This is my Both Config :

Code: Select all

<?php
//Front-End /Website
// HTTP
define('HTTP_SERVER', 'http://website.com/');
define('HTTP_IMAGE', 'http://website.com/image/');
define('HTTP_ADMIN', 'http://website.com/admin/');
define('HTTP_TEMPLATE', 'http://website.com/catalog/view/theme/');

// HTTPS
define('HTTPS_SERVER', 'http://website.com/');
define('HTTPS_IMAGE', 'http://website.com/image/');

// DIR
define('DIR_DATABASE', '/home/website/website.com/system/database/');
define('DIR_APPLICATION', str_replace('\\', '/', realpath(dirname(__FILE__))) . '/catalog/');
define('DIR_SYSTEM', str_replace('\\', '/', realpath(dirname(__FILE__))) . '/system/');
define('DIR_IMAGE', str_replace('\\', '/', realpath(dirname(__FILE__))) . '/image/');
define('DIR_STORAGE', DIR_SYSTEM . 'storage/');
define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
define('DIR_TEMPLATE', DIR_APPLICATION . 'view/theme/');
define('DIR_CONFIG', DIR_SYSTEM . 'config/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');
define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
define('DIR_LOGS', DIR_STORAGE . 'logs/');
define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
define('DIR_SESSION', DIR_STORAGE . 'session/');
define('DIR_UPLOAD', DIR_STORAGE . 'upload/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'mysql.website.com');
define('DB_USERNAME', 'website16');
define('DB_PASSWORD', 'password');
define('DB_DATABASE', 'website');
define('DB_PORT', '3306');
define('DB_PREFIX', '');

// Config Admin/Back-end
// HTTP
define('HTTP_SERVER', 'http://website.com/website/');
define('HTTP_CATALOG', 'http://website.com/');

// HTTPS
define('HTTPS_SERVER', 'http://website.com/website/');
define('HTTPS_CATALOG', 'http://website.com/');

// DIR
define('DIR_DATABASE', '/home/website/website.com/system/database/');
define('DIR_APPLICATION', str_replace('\\', '/', realpath(dirname(__FILE__))) . '/');
define('DIR_SYSTEM', str_replace('\\', '/', realpath(dirname(__FILE__) . '../')) . '/system/');
define('DIR_IMAGE', str_replace('\\', '/', realpath(dirname(__FILE__) . '../')) . '/image/');
define('DIR_STORAGE', DIR_SYSTEM . 'storage/');
define('DIR_CATALOG', '/home/website/website.com/upload/catalog/');
define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
define('DIR_TEMPLATE', DIR_APPLICATION . 'view/template/');
define('DIR_CONFIG', DIR_SYSTEM . 'config/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');
define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
define('DIR_LOGS', DIR_STORAGE . 'logs/');
define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
define('DIR_SESSION', DIR_STORAGE . 'session/');
define('DIR_UPLOAD', DIR_STORAGE . 'upload/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'mysql.website.com');
define('DB_USERNAME', 'website16');
define('DB_PASSWORD', 'password');
define('DB_DATABASE', 'website');
define('DB_PREFIX', '');
define('DB_PORT', '3306');

// OpenCart API
define('OPENCART_SERVER', 'https://www.opencart.com/');
?>
Any Advance / Experience with this error? I would appreciate any help you can offer. Thanks! :)

Re: Upgrade OC 1.5.5.1 To 3.0.1.2

Posted: Fri Nov 03, 2017 10:34 am
by IP_CAM
Well, better read here about it, this matter has been mentioned uncounted times already,
and nobody seemengly cares, to repeat it again and again:
viewtopic.php?f=141&t=199114&p=700907#p700907
Good Luck !
Ernie

Re: Upgrade OC 1.5.5.1 To 3.0.1.2

Posted: Fri Nov 03, 2017 11:25 am
by blackarch
well honestly, I already did some research how to upgrade OC even in forum.OC/stack, but i never find that link :laugh:
Let me summary it : :crazy:
So i need build another DB & site for install new OC (new)
then move old folder(style,template,any file) and old DB(table,dll) to the new OC.
Change htaccess.
If all already work then change (both) config (for new -> live (for make sure website still online)).
It is correct? :choke:

Re: Upgrade OC 1.5.5.1 To 3.0.1.2

Posted: Fri Nov 03, 2017 1:51 pm
by IP_CAM
Not really, better read it again, you can MOVE NOTHING out of your old Shop
into another Place, exept for the DATA-Content in your old DB. But this ONLY,
if this Data-Content has been made compatible with the NEW DB Structure.
And if you don't know, better get a Pro, to do this for you, you could ruin you entire Shop!
That's all, I have to say to this, good Luck ! ;)
Ernie

Re: Upgrade OC 1.5.5.1 To 3.0.1.2

Posted: Fri Nov 03, 2017 4:42 pm
by blackarch
Thanks for fast reply :)
Omg :choke:
I mean yeah it's still possible for move data if the structure table same right??
if you say so then idk how to move data product? should insert 1 by 1? :crazy: