How to migrate OpenCart to another hosting

Posted by Oleh Vasylyev 15/05/2017 0 Comment(s)

We explain here Step-by-Step how to migrate your OpenCart from your old hosting to new one.

 

1. Export the MySQL database.

The easiest way to do this is to use phpMyAdmin.

 

2. Backup the original content of your Opencart files from the root directory to your local computer.

Use your FTP client and copy all the content from public_html (or www) folder to your computer.

 

!!! If you don't understand Step 1 and Step 2 - for you and your business will be better if you hire somebody for this job.

 

3. Transfer OpenCart store files from the local computer to your new hosting.

 

4. Upload the OpenCart files from local computer to Root directory of new server.

 

5. Create new MySQL Database.

Atention! By creating Database and User of this database copy somewhere database name, user name and password. you will need this in future.

 

6. Import the old database into new one.

Use the same tool as for exporting the database.

 

7. Edit the config files config.php and admin/config.php.

The physical part of the migration process is done. Now you have to edit the 2 config.php files. First is located in the root directory of the server and second is in “admin” folder. Open the first config.php file in text editor and modify the following lines of code (path to your website on new server):

 

define(‘DIR_APPLICATION’, ‘/home/system username/public_html/newsite/catalog/’);
define(‘DIR_SYSTEM’, ‘/home/system username/public_html/newsite/system/’);
define(‘DIR_DATABASE’, ‘/home/system username/public_html/newsite/system/database/’);
define(‘DIR_LANGUAGE’, ‘/home/system username/public_html/newsite/catalog/language/’);
define(‘DIR_TEMPLATE’, ‘/home/system username/public_html/newsite/catalog/view/theme/’);
define(‘DIR_CONFIG’, ‘/home/system username/public_html/newsite/system/config/’);
define(‘DIR_IMAGE’, ‘/home/system usernamepublic_html/newsite/image/’);
define(‘DIR_CACHE’, ‘/home/system username/public_html/newsite/system/cache/’);
define(‘DIR_DOWNLOAD’, ‘/home/system username/public_html/newsite/download/’);
define(‘DIR_LOGS’, ‘/home/system username/newsite/system/logs/’);

 

– ‘system username’ usually is your cPanel username.

In the same file edit the following lines of code:

 

define(‘DB_USERNAME’, ‘your_db_username’);
define(‘DB_PASSWORD’, ‘your_db_password’);
define(‘DB_DATABASE’, ‘your_opencart_database’);

 

It is the data of the new database created in step 5.

Same thing is to be done in the admin/config.php file. Similar lines of code similar changes.

 

8. Set the file permissions of both config.php files to 444 (read-only).

Leave a Comment