What is an installation folder?
The installation folder is the place on your hosting where the OpenCart files live. If OpenCart is in public_html/shop, visitors go to yourdomain.com/shop. If you move it to public_html, visitors go to yourdomain.com.
OpenCart remembers its folder in two config files. After a move, you must update both. If you forget, the store breaks.
Warning: Back up all files and your database before you start. In File Manager use Compress. In phpMyAdmin use Export.
Steps
- Log in to the client area and open your control panel.
- Open File Manager.
- Go to the current OpenCart folder, for example
public_html/shop. - Select all files and folders. Click Show Hidden Files in the settings so you also select
.htaccess. - Click Move. Type the new path, such as
/public_html, and confirm. - Open the file
config.phpin the new folder. Right-click it and choose Edit. - Change the web addresses. These lines are named
HTTP_SERVERandHTTPS_SERVER. For example:
These lines tell OpenCart its public address.define('HTTP_SERVER', 'http://www.example.com/'); define('HTTPS_SERVER', 'https://www.example.com/'); - Change every path line that begins with
DIR_. They hold the folder paths on the server. Replace the old folder name with the new one. For example,/home/user/public_html/shop/system/becomes/home/user/public_html/system/. - Save the file.
- Open
admin/config.phpand do the same. ChangeHTTP_SERVER,HTTP_CATALOG,HTTPS_SERVER,HTTPS_CATALOGand theDIR_lines. - Open
.htaccessif you use clean addresses. Check thatRewriteBasematches the new folder. - Clear the cache by deleting the files inside
system/storage/cache. - Visit your store and your admin area. Check both load.
Tip: The exact path to your account is shown at the top of File Manager. Use it in the
DIR_ lines. OpenCart 2 and older keep their cache and logs in different folders, but the steps are the same.Quick recap
- Back up first.
- Move the files to the new folder.
- Edit
config.phpandadmin/config.php. - Check
.htaccessand clear the cache. - Test the store and admin area.