How to Transfer OpenCart from one server to another

In this tutorial we are going to learn about how to transfer the opencart site from one hosting server to another hosting server manually using FTP. During this process we are not going to update the site url, since we are transferring hosting account only not the domain name.

OpenCart is one of the most popular e-commerce platform preferred by large and small businesses for online shopping. We have already have an article on how to install OpenCart, now we are going to learn how to migrate OpenCart website from one server to another.

Step 1:

Backup OpenCart Files

One of the easiest ways to back up your opencart files is FTP, there are many FTP tools available like FileZilla, CoreFTP, Cyberduck or Others..

To download the files to the server, you need the following FTP credentials

  • FTP Host
  • Username
  • Password
  • Port(optional)

Using the FTP Credentials connect to the server and download the files.

Wait for a while till the download is complete in the mean while you can backup the database and be ready to transfer the server.

Step 2:

Backing up Database

Now we are going to get a copy of database, you can download the latest database using cpanel. Login to your cpanel then go to phpMyAdmin and Export the live database to the local system.


Now you have downloaded the files and database, you are ready to transfer the files to the new hosting account.

Step 3:

Upload OpenCart Files

Now you need to upload the opencart files to new hosting accounts, you can use FTP clients to upload. Login to the new hosting account using the FTP credentials, upload the files which you have downloaded to the local system during the process in Step 1. Make sure you upload all the files including the hidden files too, mostly htaccess and some server files are hidden.

Step 4:

Create and Configure Database

Now you have to create a MySQL database and assign a user with full access. To create the database, kindly logon to your new hosting account. After you create your MySQL database and assign a user, ensure that you note down the database credentials for further use.

  • Database Name
  • Username and
  • Password

Kindly store the database credentials for the proceeding migration process.

Once you have created the database, then go to phpMyAdmin and Import the database which you have downloaded the Step 2 of this process.


Import Opencart Database

Step 5:

Edit the config files

At this stage you have completed uploading the files to the server and imported the database to the new hosting account. Now you have to edit the cofiguration files to make the site work properly as in old hosting.

You need to edit config.php files, this file is located in two locations.

  1. root directory and
  2. admin folder

Open the file in text editor and modify the following lines of code

define(‘DB_USERNAME’, ‘your_db_username’);

define(‘DB_PASSWORD’, ‘your_db_password’);

define(‘DB_DATABASE’, ‘your_opencart_database’);

Use the credentials which you have used in Step 4. Replace your_db_username, your_db_password and your_opencart_database with appropriate values.

Repeat the above step with another file config.php in another location, such as admin/config.php. Once you have modified the configurations you are done with the migration.

Congratulations, you have successfully transferred your opencart to another server or new hosting account.


Leave a Reply

Your email address will not be published. Required fields are marked *