OpenCart is one of the simplest and most popular e-commerce platforms. However, because OpenCart uses an absolute path, it is not as simple as migrating an OpenCart website to a WordPress website. Today we will introduce two methods to migrate the OpenCart website.
Step 1 of OpenCart migration: Backup
The first step for migrating a website is backup. Backup is divided into two parts: database and website files.
It is easy to back up the database. Just use phpmyadmin to export the database as an SQL file. If the database is large, you can export it as a zip package. As for the backup file, you only need to package and download the entire main directory. Linux host (cPanel), just package and download the Public_html folder. Windows host is generally the wwwroot directory.
Step 2: restore the database
Phpmyadmin is provided for both Windows and Linux hosts. It is easy to manage mysql databases with this tool. Create a new MySQL database and write down the user name, password, and database name. Log on to phpmyadmin and import the exported SQL file. If the database is too large to be restored through phpmyadmin, you can try to use Navicat to connect to the remote database for restoration, or contact the host provider for help.
Step 3: modify the configuration file
OpenCart has two configuration files: foreground and background. Decompress the website file backed up in step 1 to your local device. First, modify the config. Php file in the root directory. First, modify the pre-defined file path to the new host path. As mentioned above, the website may be blank or error 404 due to the absolute path. Then, change the database configuration information to the latest configuration information.
Then, modify the config. Php file in the/admin Directory. The modified content is the same as that in the root directory.
Upload the file to the home directory of the website. If a problem persists after the upload. There is also the ultimate solution. Use the folder search function of notepad ++ to search for and replace all files in the folder, and change the old absolute path to a new one. Then upload the file again.
Another method for migrating an OpenCart website
Another method is also effective. Install the new OpenCart on the new host, restore the Images folder and the modules folder, and restore the database.