For OpenCart 2.3, 3.0, 4.0 and 4.1
Automatic snapshots
- Taken just before the installer copies files, before it removes an extension, and before a module is added to or removed from the extension list (2.3: the FTP copy step; 3.0 and 4.x: the installer upload and install steps).
- Steps of one install that follow each other within a set number of seconds share the first snapshot (default 30; 0 = one snapshot per step).
- Only the newest N automatic snapshots are kept (default 10, 1 to 200). Snapshots you take by hand and safety copies are never deleted for you.
- Can be switched off with the status or the "snapshot before installs" setting.
Manual snapshots
- Give a snapshot a name and take one any time, for example before editing a theme.
- A snapshot holds the admin, catalog, system and extension code folders (files up to 2 MB; config files, caches, logs and the storage folder are left out) and the extension list tables: extensions, events, modifications, install records and file lists.
- Every file is stored in a compressed archive with a checksum, so you can see what each snapshot contains.
Preview and rollback
- Preview lists the files that were changed, the files that would come back and the files added since that would be removed, and how the extension list rows differ.
- A rollback needs a confirmation. It first takes a safety copy of the present state, so a rollback can itself be undone.
- A rollback restores changed and deleted files, removes files added since, and puts the extension list tables back (events, extensions, modifications, install records). The module's own events stay in place.
- Files named in a snapshot are checked against their checksums, and only paths in the code folders are written. A tampered snapshot cannot write outside them or over config files.
For the store owner
- One admin page with a snapshot list (newest first, with kind, files, size and date), preview, rollback and delete buttons.
- Admin permissions apply: taking, previewing, rolling back and deleting need an admin login with the right permission.
- Snapshots are kept in system/storage/extension_backup, which must be writable. Uninstalling the module keeps the snapshots and their table; reinstall finds them again.
- Admin texts are in the language file and can be translated by copying it.
Notes
- Product data, orders and customers are not part of a snapshot: this is a code and extension-list backup, not a database backup.
- Ordinary files in image/ and the storage folder are not included.