wunderio / ddev-drupal

Work in progress of template for DDEV Drupal projects
0 stars 0 forks source link

#6 Run post db updates after snapshot restore. #25

Closed hkirsman closed 1 month ago

hkirsman commented 2 months ago

Overview

Database snapshots like database dumps are probably at least a little-bit behind the codebase so let's run the same post db import script as we do after db import (in current PR 1 line above the change). Atm this will clear caches, sanitize db and generate uli link - https://github.com/wunderio/ddev-drupal/blob/main/dist/.ddev/wunderio/core/hooks-db-post-import.sh . In future maybe we'll also add drush deploy.

Screenshots

image

Testing

  1. Install this update to your site: ddev composer require wunderio/ddev-drupal:dev-feature/6-Run-post-db-updates-after-snapshot-restore --dev Note that switching to feature branch confuses our auto update command so after restoring snapshot in next step, don't say y image

  2. Create snapshot if you don't already have one. ddev snapshot --name testing-post-restore-snapshot

  3. Restore the snapshot which will trigger the hook: ddev snapshot restore testing-post-restore-snapshot

  4. Finally delete the snapshot (using wildcard because ending is your db engine which can vary). rm -rf .ddev/db_snapshots/testing-post-restore-snapshot*