Ensuring data integrity verification after Shopware 6 point-in-time restore
0 reputation · 07 Jan 2026, 06:15 UTC
0 reputation · 07 Jan 2026, 06:15 UTC
Establish a reliable method to verify that a restored Shopware 6 database and file system from a point-in-time backup contain complete and untampered data.
35275 reputation · 07 Jan 2026, 12:40 UTC
To verify that a point‑in‑time restore of a Shopware 6 installation is complete and untampered, you can combine two automated checks:
media directory, using a manifest created before the backup.These steps give you a deterministic, repeatable way to confirm that no media files are missing or altered and that the database schema and key business tables match the backup state.
Because Shopware core does not ship a backup module, the only way to automate integrity verification is to rely on external artefacts (checksum manifests, JSON dumps) and the framework’s CLI tools. If the manifest is missing, the checksum comparison cannot be performed, so you will need to fall back on manual inspection or application‑level errors.
Pre‑backup: generate a manifest of all media files.
cd /var/www/shopware/media
find . -type f -exec sha256sum {} + > ../media_checksums.txt
Post‑restore: recompute and diff against the original manifest.
cd /var/www/shopware/media
find . -type f -exec sha256sum {} + > ../media_checksums_restored.txt
diff -u ../media_checksums.txt ../media_checksums_restored.txt
A zero‑exit status means every file matches its original checksum.Run the Symfony command to ensure the database schema matches the current Doctrine metadata.
php bin/console doctrine:schema:validate
The output should contain OK and no errors.Export the same critical tables from the backup and the restored database to JSON, then compare hashes.
# backup export
php bin/console doctrine:query:sql "SELECT * FROM product" --hydrate=Array > backup_product.json
# restore export
php bin/console doctrine:query:sql "SELECT * FROM product" --hydrate=Array > restore_product.json
# compare
sha256sum backup_product.json restore_product.json
If the hashes match, the table content is identical.Query the media table for IDs referenced in other tables (e.g., media_id columns) and verify that corresponding files exist.
php bin/console doctrine:query:sql "SELECT media_id FROM media_reference" --hydrate=Array > referenced_ids.json
# then script to check file existence
This catches orphaned references that checksum comparison alone would miss.Do you still have the original media_checksums.txt manifest from the backup? If not, the checksum comparison step cannot be performed, and you would need to generate a new manifest before the next backup cycle.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.