Upgrading DAM
DAM includes an upgrade script that fetches the latest release, swaps the package code, and runs the post-upgrade migration with a safety backup.
Before You Start
- Take your own database backup. The upgrade takes one too, but a second copy costs nothing.
- Put the site in maintenance mode if you cannot tolerate a brief interruption.
- Make sure
php,curl, andunzipare available on the server — the script requires all three.
The Upgrade Script
Run this from your UnoPim project root:
bash packages/Webkul/DAM/upgrade-dam.shThe script:
- Checks that
php,curl, andunzipare present. - Reads your currently installed version (
php artisan dam:version). - Looks up the latest release on GitHub. If you are already up to date, it stops here.
- Downloads and validates the release archive.
- Replaces the code in
packages/Webkul/DAM— code only. Your database and your asset files are not touched at this stage. - Runs
php artisan dam:update, which backs up, migrates, publishes, and verifies.
Upgrading via Composer
If you installed DAM with Composer, update the package and then run the post-upgrade routine yourself:
composer update unopim/dam
php artisan dam:update
php artisan optimize:cleardam:update is the important part — it takes the backup, applies the new migrations, republishes assets, and verifies no data was lost. See Artisan Commands.
If Something Goes Wrong
dam:update compares row counts before and after migrating. If it detects data loss, it aborts and prints the restore command.
To see the available backups:
php artisan dam:update:restoreTo roll back to one:
php artisan dam:update:restore 2026-07-13-104500Backups live in storage/dam-backups/<timestamp> and contain both the DAM database tables and the asset files.
After Upgrading
Restart your queue workers so they pick up the new code:
bashphp artisan queue:restart # or, under Supervisor sudo supervisorctl restart unopim-workerClear caches:
bashphp artisan optimize:clearIf you are coming from a version before thumbnails existed, generate them for your existing PDFs and videos:
bashphp artisan dam:backfill-thumbnails