Our company opens in about 1 hour at 09:00 UK time. Send your request now and we will review it when we are back.

Backup Guide for OpenCart

Protect your store by creating regular backups

Why are Backups important?

Backups are vital for each website, especially for an e-shop. They protect you from:

  • Data loss due to hardware or software errors.
  • Problems when upgrading OpenCart or extensions.
  • Security attacks or malicious software.
  • Human errors in management.

A recent backup allows you to quickly get your store back up and running, minimizing lost revenue and inconvenience.

OpenCart Database Backup

The database contains all critical information: products, categories, customers, orders, etc.

Method 1: Use phpMyAdmin

  1. Connect to your hosting control panel (cPanel, Plesk etc.).
  2. Find and open the tool phpMyAdmin.
  3. Select your OpenCart store database from the left column.
  4. Click on the tab "Export" on the top menu.
  5. For most cases, the "fast" (Quick) extraction method in SQL format is sufficient. Click the button "Go/Perform".
  6. Save the file .sql which will be created on your computer in a safe place.

Method 2: Use the command line (SSH/Terminal)

If you have SSH access to your server, you can use the command mysqldump:

mysqldump -u [username] -p[password] [database_name] > backup_`date +%Y-%m-%d`.sql

Replace them [username], [password] (note: no space after -p) and [database_name] with your own details. This command creates a SQL file with the current date in the filename.

OpenCart File Backup

Files include the OpenCart codebase, themes, extensions, product images, and custom assets.

Method: Use FTP Client or File Manager

  1. Connect to your server using an FTP client (e.g., FileZilla, WinSCP) or File Manager of your control panel.
  2. Navigate to OpenCart's main installation folder (usually public_html, httpdocs, or a subfolder within them).
  3. Select all OpenCart files and folders.
  4. Download them (Download) on your computer or create a compressed file (e.g., .zip, .tar.gz) directly on the server via File Manager and then download it.
  5. Save files to a safe place, separate from the database backup.

Important folders/files to backup:

  • All core folders (admin, catalog, system, image etc.)
  • File config.php (in the main folder)
  • File admin/config.php
  • Any custom files or themes you have added.

Backup automation

Manual backup is good, but automation ensures that it is done regularly without forgetting it.

CPanel Automation

  1. Connect to cPanel.
  2. Look for the "Files" section and select it "Backups" or "Backup Wizard".
  3. The cPanel usually offers options for full backup (Full Backup) or some backups (Partial Backups – e.g., only Home Directory or MySQL Databases only).
  4. You can create a full backup and download it.
  5. For planned backups, look for third-party tools or settings that your hosting provider can offer, or use Cron Jobs to perform scripts that create backups (e.g., with mysqldump and tar for the files). For detailed instructions on Cron Jobs setting, see Our detailed guide for Cron Jobs.

Note for Cron Jobs

Cron Jobs configuration requires technical knowledge. Make sure you understand the orders before you use them. An example of cron command for daily base backup (more examples in Cron Jobs Driver):

0 2 * * * /usr/bin/mysqldump -u [username] -p[password] [database_name] | gzip > /home/[cpanel_user]/backups/db_backup_`date +\%Y-\%m-\%d`.sql.gz

(Replace items and path).

Plesk Automation

  1. Connect to Plesk.
  2. Go to "Websites & Domains" and choose your domain.
  3. Click on "Backup Manager" (Backup Management).
  4. Click on "Back Up" (Create Backup) for immediate backup or at "Schedule" (Schedule) to set up automatic backups.
  5. In the schedule, you can set frequency, time, backup type, and whether the backup includes files, databases, or both.
  6. You can also configure the storage of backups in remote space (e.g., FTP, Dropbox, Google Drive) for greater security.

Backup best practices

  • Frequency: Create backups regularly. For an active e-shop, daily backups are ideal.
  • Save: Do not save backups only on the same server as your site. Use external hard drives, cloud storage (Dropbox, Google Drive, S3) or special backup services.
  • Retention: Keep multiple versions of backups (e.g., the last 7 daily, 4 weekly).
  • Test: Occasionally, try to restore a backup to a test environment to make sure your backups are valid and the reset process works.
  • Security: Protect your backup files with passwords or encryption, especially if they contain sensitive data.

Secure your OpenCart store today

Don't leave your data security to chance. Contact us for professional support and setup of automated backups.

Ask for support