- Categories: E-Commerce Software
- Date Added: 22/12/2021
- Date Modified: 23/03/2022
You can update your old OpenCart version to a newer version by following the steps below. The steps here are explained as a guide and the responsibility for the data loss you will experience in case of any mishap belongs entirely to the person who applies it.
BEFORE STARTING THE UPDATE PROCESS, MUST MAKE A WORKING BACKUP OF ALL YOUR FILES AND DATABASE.
If you do not have an OpenCart e-commerce site installed before, you can have information about the installation from How to Install OpenCart? article.
Considerations Before You Begin
1. It is recommended that you read this guide several times. Thus, you will have a better understanding of all the steps and minimize your error rate.
2. If there are 3rd party plugins that you add to OpenCart, such as modules, shipping methods, payment methods, order totals and product feeds, check if it is compatible with the version you want to update. If not, uninstall them using OpenCart administration panel.
3. Select the default theme from the theme settings and save. Check if your theme is compatible with the OpenCart version you want to update. If not, you cannot use your old OpenCart theme.
4. If you have made changes to the system files manually, they will lose their validity after the update. To use these changes again, you need to add them again in accordance with the new version.
5. If you are going to update to OpenCart 3.0.2.0 or newer, change the url_alias table name from the database to seo_url.
6. Delete the cache files under system/storage/cache in OpenCart main directory or system/cache depending on your version.
7. If you are using CloudFlare or a similar system, clear its cache and disable it until the update process is complete.
8. After the update; Your Customers, Products, Orders, Categories, Information pages, etc. data in the database will remain, but all plugins and themes that are not compatible with the version you have updated will not be available.
Note: If you want to change your mind after the update and switch to the old version, and there are new data entries (new customer, order, product, category, etc.) in the meantime, you will lose this data and your backups that you took before the update will be restored.
OpenCart Update Steps
1. Download the files of the version you want to update from the OpenCart release list.
2. Extract the OpenCart zip file of the downloaded version to a folder on your computer. When you extract the zip file, it will look like below.
3. Navigate to the "upload" directory in the extracted folder. Here, delete the config-dist.php and admin/config-dist.php files and the image/catalog directory.
4. Go to the directory where OpenCart is installed on your FTP server. Delete all but the config.php and admin/config.php files in this directory and the image directory. If you have Downloadable Products, do not delete them download directory. The download directory may be in the main directory, under the system or system/storage directories, depending on the version you are using.
5. Now upload the updated version files you prepared in step 3 to the OpenCart directory of your FTP server in step 4.
6. Type yoursite/install path in the browser address bar and press Enter to run the update software. If your website is installed in a subdirectory, change the update address to this. The following update page will appear. If you encounter the installation page instead of the Update page, check the config.php and admin/config.php files or try again by uploading from your backups. Click the "Continue" button to start the update.
7. The successful update process should be as follows.
8. After your database update processes are completed, follow the items below.
- Refresh the Administration and Catalog page by pressing Ctrl+F5 twice for CSS/JavaScript changes.
- Empty your website cache in your browser to fix JavaScript and Token errors. You can also empty the entire cache if you don't know how. However, data from other websites will be lost.
- Login to OpenCart Administration panel as administrator.
- From the Administration->Users->User Groups page, tick all the boxes for the Administrator group and save. In this way, you will ensure that you have the necessary permissions for all new files.
- Go to Admin->System->Stores page and review the settings. Enter values according to you and save the newly added settings. Save the settings even if you don't make any changes.
- If you intend to use vQmod, download and install the latest version from https://github.com/vqmod/vqmod/wiki.
After the Update
1. If you have updated to OpenCart 3.0.2.0 or 3.0.3.2, log in to phpMyAdmin page, select the database where OpenCart is installed and run the following queries in the SQL tab. Don't forget to replace the "oc_" prefix with your own prefix inside the scripts before running.
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(1, 'activity_customer_add', 'catalog/model/account/customer/addCustomer/after', 'event/activity/addCustomer', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(2, 'activity_customer_edit', 'catalog/model/account/customer/editCustomer/after', 'event/activity/editCustomer', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(3, 'activity_customer_password', 'catalog/model/account/customer/editPassword/after', 'event/activity/editPassword', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(4, 'activity_customer_forgotten', 'catalog/model/account/customer/editCode/after', 'event/activity/forgotten', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(5, 'activity_transaction', 'catalog/model/account/customer/addTransaction/after', 'event/activity/addTransaction', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(6, 'activity_customer_login', 'catalog/model/account/customer/deleteLoginAttempts/after', 'event/activity/login', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(7, 'activity_address_add', 'catalog/model/account/address/addAddress/after', 'event/activity/addAddress', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(8, 'activity_address_edit', 'catalog/model/account/address/editAddress/after', 'event/activity/editAddress', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(9, 'activity_address_delete', 'catalog/model/account/address/deleteAddress/after', 'event/activity/deleteAddress', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(10, 'activity_affiliate_add', 'catalog/model/account/customer/addAffiliate/after', 'event/activity/addAffiliate', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(11, 'activity_affiliate_edit', 'catalog/model/account/customer/editAffiliate/after', 'event/activity/editAffiliate', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(12, 'activity_order_add', 'catalog/model/checkout/order/addOrderHistory/before', 'event/activity/addOrderHistory', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(13, 'activity_return_add', 'catalog/model/account/return/addReturn/after', 'event/activity/addReturn', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(14, 'mail_transaction', 'catalog/model/account/customer/addTransaction/after', 'mail/transaction', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(15, 'mail_forgotten', 'catalog/model/account/customer/editCode/after', 'mail/forgotten', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(16, 'mail_customer_add', 'catalog/model/account/customer/addCustomer/after', 'mail/register', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(17, 'mail_customer_alert', 'catalog/model/account/customer/addCustomer/after', 'mail/register/alert', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(18, 'mail_affiliate_add', 'catalog/model/account/customer/addAffiliate/after', 'mail/affiliate', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(19, 'mail_affiliate_alert', 'catalog/model/account/customer/addAffiliate/after', 'mail/affiliate/alert', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(20, 'mail_voucher', 'catalog/model/checkout/order/addOrderHistory/after', 'extension/total/voucher/send', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(21, 'mail_order_add', 'catalog/model/checkout/order/addOrderHistory/before', 'mail/order', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(22, 'mail_order_alert', 'catalog/model/checkout/order/addOrderHistory/before', 'mail/order/alert', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(23, 'statistics_review_add', 'catalog/model/catalog/review/addReview/after', 'event/statistics/addReview', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(24, 'statistics_return_add', 'catalog/model/account/return/addReturn/after', 'event/statistics/addReturn', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(25, 'statistics_order_history', 'catalog/model/checkout/order/addOrderHistory/after', 'event/statistics/addOrderHistory', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(26, 'admin_mail_affiliate_approve', 'admin/model/customer/customer_approval/approveAffiliate/after', 'mail/affiliate/approve', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(27, 'admin_mail_affiliate_deny', 'admin/model/customer/customer_approval/denyAffiliate/after', 'mail/affiliate/deny', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(28, 'admin_mail_customer_approve', 'admin/model/customer/customer_approval/approveCustomer/after', 'mail/customer/approve', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(29, 'admin_mail_customer_deny', 'admin/model/customer/customer_approval/denyCustomer/after', 'mail/customer/deny', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(30, 'admin_mail_reward', 'admin/model/customer/customer/addReward/after', 'mail/reward', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(31, 'admin_mail_transaction', 'admin/model/customer/customer/addTransaction/after', 'mail/transaction', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(32, 'admin_mail_return', 'admin/model/sale/return/addReturn/after', 'mail/return', 1);
INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`) VALUES
(33, 'admin_mail_forgotten', 'admin/model/user/user/editCode/after', 'mail/forgotten', 1);
2. If you have add-ons such as 3rd party modules, themes, vQmod and Ocmod that are compatible with the version you used and updated before, update them by referring to their own update guides. Remove incompatible vQmod and Ocmod modifications and press "Clear" and "Refresh" buttons respectively from Extensions->Modifications page.
3. If you have updated to OpenCart 2.1.0.1, log in to phpMyAdmin page, select the database where OpenCart is installed and run the following queries in the SQL tab. Don't forget to replace the "oc_" prefix with your own prefix inside the scripts before running.
DROP TABLE IF EXISTS `oc_api`;
CREATE TABLE `oc_api` (
`api_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(64) NOT NULL,
`key` text NOT NULL,
`status` tinyint(1) NOT NULL,
`date_added` datetime NOT NULL,
`date_modified` datetime NOT NULL,
PRIMARY KEY (`api_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
DROP TABLE IF EXISTS `oc_api_ip`;
CREATE TABLE `oc_api_ip` (
`api_ip_id` int(11) NOT NULL AUTO_INCREMENT,
`api_id` int(11) NOT NULL,
`ip` varchar(40) NOT NULL,
PRIMARY KEY (`api_ip_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
DROP TABLE IF EXISTS `oc_api_session`;
CREATE TABLE `oc_api_session` (
`api_session_id` int(11) NOT NULL AUTO_INCREMENT,
`api_id` int(11) NOT NULL,
`token` varchar(32) NOT NULL,
`session_id` varchar(32) NOT NULL,
`session_name` varchar(32) NOT NULL,
`ip` varchar(40) NOT NULL,
`date_added` datetime NOT NULL,
`date_modified` datetime NOT NULL,
PRIMARY KEY (`api_session_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
DROP TABLE IF EXISTS `oc_cart`;
CREATE TABLE `oc_cart` (
`cart_id` int(11) NOT NULL AUTO_INCREMENT,
`customer_id` int(11) NOT NULL,
`session_id` varchar(32) NOT NULL,
`product_id` int(11) NOT NULL,
`recurring_id` int(11) NOT NULL,
`option` text NOT NULL,
`quantity` int(5) NOT NULL,
`date_added` datetime NOT NULL,
PRIMARY KEY (`cart_id`),
KEY `cart_id` (`customer_id`,`session_id`,`product_id`,`recurring_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
DROP TABLE IF EXISTS `oc_customer_wishlist`;
CREATE TABLE `oc_customer_wishlist` (
`customer_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`date_added` datetime NOT NULL,
PRIMARY KEY (`customer_id`,`product_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
ALTER TABLE `oc_customer` CHANGE COLUMN `token` `token` text NOT NULL;
DROP TABLE IF EXISTS `oc_customer_ban_ip`;
Congratulations!
If you have come this far successfully, you now have an up-to-date OpenCart software.
If the above steps are complicated for you or you want to purchase professional support, you can purchase the OpenCart Update option here.