TechBuzzPro

How to Back Up and Restore Files in OpenCart

· 6 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You back up an OpenCart store in two separate pieces: the database (products, orders, customers, settings) and the files (images, extensions, config files). Restoring means putting both back in the right order. There is no single "backup everything" button in OpenCart, so the reliable method is a database export plus a file download, and the reverse for restore. Do the database first, then the files, and keep both copies together with a note of the OpenCart version and the date.

What You'll Need

  • Admin access to your OpenCart dashboard (for the built-in backup tool).
  • Hosting control panel access (cPanel, Plesk, or similar) or FTP/SFTP credentials for the file backup.
  • Database access details from config.php in the OpenCart root (host, database name, username, password, prefix).
  • phpMyAdmin or another database tool available in your hosting panel.
  • Enough free space on your computer or cloud drive for a full copy of the site files, including the image/ folder.

Step-by-Step

  1. Put the store in maintenance mode. In the OpenCart admin, go to System > Settings, edit your store, open the Server tab, and set Maintenance Mode to Yes. Save. This stops customers placing orders while you copy data. Menu labels can differ slightly by OpenCart version.
  2. Export the database from the admin. Go to System > Maintenance > Backup/Restore. Leave the tables selected (or select all), click Backup, and save the .sql file it downloads. This is the fastest way to get a consistent database dump.
  3. Check the dump file. Open the .sql file in a text editor and confirm it contains CREATE TABLE and INSERT statements and is not empty. A 0 KB file means the export failed and must be repeated.
  4. Download the site files. Connect with FTP/SFTP or use your host's File Manager and download the entire OpenCart folder to your computer. Include config.php, admin/config.php, image/, catalog/, system/, extension/, and any custom vqmod/ or ocmod/ folders. Do not skip the image folder; it is usually the largest part.
  5. Store the two copies together. Put the .sql file and the zipped site folder in one dated folder, for example opencart-backup-2025-06-01. Note the OpenCart version from the admin footer and any extensions you have installed.
  6. To restore the database, go to System > Maintenance > Backup/Restore in the admin, click Restore, choose your .sql file, and upload it. Wait for the success message. Large dumps may time out; if so, import the file through phpMyAdmin instead (see Troubleshooting).
  7. To restore the files, upload the backed-up OpenCart folder over the existing installation via FTP or File Manager, overwriting when prompted. Keep the same folder structure. If you are restoring to a new host or domain, edit config.php and admin/config.php first with the new database details and URLs.
  8. Clear the cache and test. In the admin, go to the Dashboard and use the gear icon to refresh the theme and SASS caches, or delete the contents of system/storage/cache/ via FTP. Then open the storefront, place a test order, and log in to the admin to confirm products and orders appear.
  9. Turn maintenance mode off in System > Settings > Server once everything checks out.

Common Mistakes

  • Backing up only the database and forgetting the image/ folder, which leaves products with missing pictures after a restore.
  • Restoring files but not the database, or the other way round. The two must match; a database from one date with files from another can break extensions.
  • Using the admin backup tool on a very large database and assuming it worked when the download was empty or cut short.
  • Overwriting config.php during a move to a new host without updating the database credentials and store URL.
  • Leaving maintenance mode on after finishing, so customers see the maintenance page.
  • Storing backups only on the same server. If the server fails, the backup goes with it.

Tips

  • Back up before every extension install, theme change, or OpenCart version upgrade. Those are the changes most likely to need a rollback.
  • Keep at least two recent backups in different places, such as your computer and a cloud drive.
  • Zip the site folder before downloading; it transfers faster and preserves file permissions better than thousands of small files.
  • Write the OpenCart version and the date in the folder name so you can match a database to its files later.
  • Test a restore on a staging copy before you rely on the backup for a live emergency.

Troubleshooting

The admin restore upload fails or times out. Large .sql files often exceed PHP upload and execution limits. Import the file through phpMyAdmin in your hosting panel instead: select the database, open the Import tab, choose the file, and run it. If it still fails, ask your host to raise the limits or import it from the command line.

The store shows a database error after restoring files. The credentials in config.php and admin/config.php do not match the database on this server. Open both files and check the hostname, username, password, database name, and table prefix.

Images or the layout look broken. Clear the cache folder and check that the image/ directory was uploaded completely. Also confirm the store URL in Settings matches the domain you are using.

You restored the wrong database. Restore the correct .sql file over it; do not try to merge two dumps by hand. Keep the store in maintenance mode until the right data is back.

Extensions disappeared. Some extensions store settings in the database and files in extension/. If only one was restored, reinstall the extension files and re-save its settings.

Frequently Asked Questions

Does OpenCart have a one-click full backup?

No. The built-in tool under System > Maintenance > Backup/Restore handles the database only. Files must be copied separately through FTP or your host's File Manager.

Can I restore a backup to a different domain?

Yes, but update the store URL in Settings and the database details in both config.php files before or after the restore, then clear the cache.

How often should I back up?

At minimum before every change to extensions, themes, or core files, plus a regular schedule such as weekly for a busy store. The database changes daily with orders, so it deserves the more frequent copy.

Will restoring the database delete orders placed after the backup?

Yes. A restore replaces the current database with the backed-up one, so any orders, customers, or products added after that date are lost. Export the current database first if you might need it.

Where are the OpenCart files stored on the server?

In the folder where OpenCart was installed, usually public_html or a subfolder such as public_html/shop. The same folder contains config.php and the image/ directory.

Do I need to back up the system/storage folder?

Yes, if it sits outside the main install it still holds logs, cache, and uploaded modification files. Include it in the file copy, but you can safely clear its cache subfolder after a restore.