Latest Blog Posts

Editing the OpenCart Homepage
29.09.2025 3984 5 44 min

Editing the OpenCart homepage, customizing H1 and Title text, displaying products and modu..

How to Uninstall Powered by OpenCart
03.09.2025 5831 3 20 min

Remove Powered by OpenCart and customize footer: edit template, use theme editor or OCMOD ..

How to remove modules in OpenCart
28.08.2025 2569 3 12 min

Step-by-step instructions for deleting modules in OpenCart 3 via the admin panel, manually..

Which hosting to choose for OpenCart
25.08.2025 1821 3 19 min

Find out which hosting to choose for an OpenCart online store. Requirements, selection cri..

How to transfer an OpenCart website to another hosting

30.08.2025 25911 9 5 min
How to transfer an OpenCart website to another hosting

Don't know how to move opencart to another hosting? It's elementary!

Create backup copies of site files

First, you need to copy all the site files to your computer. Open an FTP client program, such as FileZilla Client , and move the contents of the site's root directory to a separate folder on your PC. You can also download the archive with files through the file manager in the hosting account panel.

When transferring a site to another hosting, it is important to remember that along with the main OpenCart structure, you must also transfer the storage folder, since it stores logs, sessions, cache and other service data, without which the site will not work correctly. Initially, it is located in the system directory, but after the initial installation of OpenCart on the hosting, the installer offers to move it to another location chosen by the administrator. You can also see where it was moved in the configuration file in the DIR_STORAGE constant.

Создаем резервные копии файлов сайта

Clearing image cache

Also, to save space and time, it is not necessary to copy the image cache from the image/cache folder - the first time you access the store pages, the system will automatically recreate the thumbnails and other cached files. This significantly saves time and speeds up the migration process itself, especially if the product catalog contains thousands of images.

Удалени кеша изображений

Creating a backup copy of the database

Next, open PhpMyAdmin and export the required database of our store. If you have several of them and you do not remember which one belongs to the transferred site, open the config.php file in the root of the site and look at its name in the DB_DATABASE constant.

To export tables in PhpMyAdmin, go to the database and go to the Export section, select the SQL format and click the Forward button.

Создаем резервные копии базы данных

Done! Now we have copies of the OpenCart database and files.

Preparing an OpenCart store for transfer to a new hosting

In the config.php files, specify the current parameters of the new site

  1. new domain if it changes
  2. new paths to root directory
  3. database data

If you don't know the path to the main directory on the disk, create and open the info.php file with the content

<?php phpinfo(); ?>

by link http://www.newsite.com/info.php

At the bottom of the page, information about the path in the _ENV["SCRIPT_FILENAME"] variable will be displayed.

You can also create a universal config, but keep in mind that depending on the server configuration, bugs may be observed in the operation of the site modules. For example, after installing or transferring OpenCart to a hosting with universal configs, the button for opening the image manager does not work.

For config.php

<?php
// HTTP
$host = $_SERVER['HTTP_HOST'];
define('HTTP_SERVER', 'http://'.$host.'/');
// HTTPS
define('HTTPS_SERVER', 'http://'.$host.'/');
// DIR
$dir = dirname(__FILE__);
define('DIR_APPLICATION', $dir . '/catalog/');
define('DIR_SYSTEM', $dir . '/system/');
define('DIR_IMAGE', $dir . '/image/');
define('DIR_LANGUAGE', $dir . '/catalog/language/');
define('DIR_TEMPLATE', $dir . '/catalog/view/theme/');
define('DIR_CONFIG', $dir . '/system/config/');
define('DIR_CACHE', $dir . '/system/storage/cache/');
define('DIR_DOWNLOAD', $dir . '/system/storage/download/');
define('DIR_LOGS', $dir . '/system/storage/logs/');
define('DIR_MODIFICATION', $dir . '/system/storage/modification/');
define('DIR_UPLOAD', $dir . '/system/storage/upload/');
//DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', 'pass');
define('DB_DATABASE', 'basename');
define('DB_PORT', '3306');
define('DB_PREFIX', 'oc_');

For admin/config.php

<?php
// HTTP// HTTP
$host = $_SERVER['HTTP_HOST'];
define('HTTP_SERVER', 'http://'.$host.'/admin/');
define('HTTP_CATALOG', 'http://'.$host.'/');
// HTTPS
define('HTTPS_SERVER', 'http://'.$host.'/admin/');
define('HTTPS_CATALOG', 'http://'.$host.'/');
// DIR
$dir = dirname(dirname(__FILE__));
define('DIR_APPLICATION', $dir . '/admin/');
define('DIR_SYSTEM', $dir . '/system/');
define('DIR_IMAGE', $dir . '/image/');
define('DIR_LANGUAGE', $dir . '/admin/language/');
define('DIR_TEMPLATE', $dir . '/admin/view/template/');
define('DIR_CONFIG', $dir . '/system/config/');
define('DIR_CACHE', $dir . '/system/storage/cache/');
define('DIR_DOWNLOAD', $dir . '/system/storage/download/');
define('DIR_LOGS', $dir . '/system/storage/logs/');
define('DIR_MODIFICATION', $dir . '/system/storage/modification/');
define('DIR_UPLOAD', $dir . '/system/storage/upload/');
define('DIR_CATALOG', $dir . '/catalog/');
//DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', 'pass');
define('DB_DATABASE', 'basename');
define('DB_PORT', '3306');
define('DB_PREFIX', 'oc_');

When changing the domain, open the database dump in a text editor and replace the old domain with the new one.

OpenCart website migration to hosting/server

We move previously copied and modified files to the root directory on the new hosting.

We set the rights 0777 on the folders:

image/
image/cache/
image/catalog/ 
system/storage/cache/
system/storage/logs/
system/storage/download/

We import the dump into a new database.

We go to the admin panel and update the modifier cache.

That's it! Now you know how to transfer Opencart to another hosting

Products related to this post

Transfer to another domain
3 576 грн.2 235 грн.
Moving OpenCart to another domain is a technically complex task that requires precision and a deep understanding of all internal C..
Installation and configuration
4 470 грн.2 235 грн.
Our professional OpenCart/OcStore CMS installation, configuration and optimization services give you the opportunity to launch a f..
Seamless OpenCart Migration to Another Server
3 576 грн.2 235 грн.
If you are looking for how to transfer an OpenCart online store to a new hosting, you are at the right place. We will take on the ..
ChatGPT Consultant

Comments

Leave your comment or question
Есть отличия в переносе сайта со сменой домена в ocstore 2.1 от opencart 2.3?
Answer Admin
В базе данных сделайте автозамену на новый домен.
Не абсолютно никакой разницы!
При переносе на другой хостинг, сыпятся варнинги и ошибка. Пути подключены верно, но без результатно. Куда копать? Заранее спасибо.
Answer Admin

Покажите варнинги.

1) Заливаем все файлы на хостинг. Создаем пустую базу . 2)Вычищаем содержимое двух файлов config.php (один в корне магазина другой в папке admin) 3)Отсюда качаем свою версию и забираем из неё только папку Install , которую так же заливаем в магазин в корневую папку 4) При этом база данных пока должна быть абсолютно пустой 5) Открываем в браузере свой магазин,если всё сделано как я написал пойдёт процесс установки 6)Ставим магазин как обычно 7)Заходим в админку после установки 8)Возвращаемся в базу данных,открываем её,выделяем все только что созданные таблицы и чистим. 9)После очистки в самом верху жмём "Импорт" 10)И импортируем базу данных того магазина что переносим 11)Останется только удалить папку install,
Answer Admin

Список бесполезных действий если на сайте был нестандартный шаблон, модуль или модификатор.

И никто не пишет в этих многочисленных копипастах, нужно ли переносить папку storage. И что можно не копировать кэш изображений, что ускоряет весь процесс переезда.
Opencart 4. Как перенести локальный сайт? На хостинге уже все оплачено. Или помогите за оплату.
Answer Admin

Следуйте инструкции. Или напишите мне в телеграм. Помогу.

Перенос opencart с локального сервера на хостинг по этой же инструкции сделала. Все работает, ошибки не сыпятся. Благодарю.
Answer Admin

Перенос на хостинг с локалки не будет отличаться. Главное забрать файлы и внести правильно в них изменения. А именно, изменить домен, если он меняется и пути к новой директории на новом хостинге.

Переместил сайт с компьютера на хостинг всего за пару часов. На самом деле ничего сложно при минимальных навыках. Спасибо за помощь и подсказки.
Как перенести директорию storage в opencart 3
Answer Admin
  1. Скопируйте папку system/storage/ за пределы корня сайта (или куда вам нужно) например /home/public_html/storage/
  2. Откройте файлы config.php и admin/config.php
  3. Найдите определение DIR_STORAGE и замените на полный путь например
    define('DIR_STORAGE', DIR_SYSTEM . 'storage/');

    замените на

    define('DIR_STORAGE', '/home/public_html/storage/');
    
  4. Проверьте права доступа у новой папки например 755 или 775
  5. Проверьте работу сайта и логов затем при успехе удалите старую папку system/storage/

Write Comment

Popular