Notice: Trying to get property of non-object in /var/www/html/yellopen/catalog/model/magikblog/article.php on line 307Notice: Trying to get property of non-object in /var/www/html/yellopen/catalog/model/magikblog/article.php on line 296 How to move/migrate OpenCart to a new host/server

How to move/migrate OpenCart to a new host/server?

Opencart, a robust e-commerce solution for merchants to create their own online business and participate in e-commerce at a minimal cost. OpenCart is a turn-key ready "out of the box" shopping cart solution. You simply install, select your template, add products and you’re ready to start accepting orders.

OpenCart can be easily migrated to a new web server. Here are steps to migrate:

1. Download all the OpenCart files from your existing web server.
2. Create backup of Database through PhpMyAdmin from old server.
3. Upload files to NEW SERVER
4. Install Database on NEW SERVER through PhpMyAdmin
5. Edit config.php and admin/config.php. These files contain the filesystem paths to OpenCart folders, URLs to OpenCart frontend and admin, and database access details. The paths and database details will most likely need to be updated, and the URLs will need to be changed only if the OpenCart store's domain has changed.

If you are uploading the copied site to a subdirectory on new server you need to specify the path in the following files

1. config.php

<?php
// HTTP
define('HTTP_SERVER', 'http://yourdomain.com/');

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

// DIR
define('DIR_APPLICATION', '/var/www/html/catalog/');
define('DIR_SYSTEM', '/var/www/html/system/');
define('DIR_IMAGE', '/var/www/html/image/');
define('DIR_LANGUAGE', '/var/www/html/catalog/language/');
define('DIR_TEMPLATE', '/var/www/html/catalog/view/theme/');
define('DIR_CONFIG', '/var/www/html/system/config/');
define('DIR_CACHE', '/var/www/html/system/storage/cache/');
define('DIR_DOWNLOAD', '/var/www/html/system/storage/download/');
define('DIR_LOGS', '/var/www/html/system/storage/logs/');
define('DIR_MODIFICATION', '/var/www/html/system/storage/modification/');
define('DIR_UPLOAD', '/var/www/html/system/storage/upload/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'database_username');
define('DB_PASSWORD', 'database_password');
define('DB_DATABASE', 'database_name');
define('DB_PORT', '3306');
define('DB_PREFIX', 'oc_');

2. admin/config.php

<?php
// HTTP
define('HTTP_SERVER', 'http://yourdomain.com/admin/');
define('HTTP_CATALOG', 'http://yourdomain.com/');

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

// DIR
define('DIR_APPLICATION', '/var/www/html/admin/');
define('DIR_SYSTEM', '/var/www/html/system/');
define('DIR_IMAGE', '/var/www/html/image/');
define('DIR_LANGUAGE', '/var/www/html/admin/language/');
define('DIR_TEMPLATE', '/var/www/html/admin/view/template/');
define('DIR_CONFIG', '/var/www/html/system/config/');
define('DIR_CACHE', '/var/www/html/system/storage/cache/');
define('DIR_DOWNLOAD', '/var/www/html/system/storage/download/');
define('DIR_LOGS', '/var/www/html/system/storage/logs/');
define('DIR_MODIFICATION', '/var/www/html/system/storage/modification/');
define('DIR_UPLOAD', '/var/www/html/system/storage/upload/');
define('DIR_CATALOG', '/var/www/html/catalog/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'database_username');
define('DB_PASSWORD', 'database_passwrod');
define('DB_DATABASE', 'database_name');
define('DB_PORT', '3306');
define('DB_PREFIX', 'oc_');