DDEV

✅ 1. Stop the project first

ddev stop

✅ 2. Clean the project directory (files)

rm -rf ~/projects/projectname/*
check if .ddev is still present
ls -a

✅ 3. Extract production files

unzip /mnt/d/drupal/sites/CUST/customer/projectname.zip -d ~/projects/projectname

✅ 4. Start DDEV

ddev start

✅ 5. Import the production database

ddev import-db --file=/mnt/d/drupal/sites/CUST/customer//projectname.sql

✅ 6. Rebuild dependencies (important!)

Tags

The symptom was that the frontpage which only contained the default node view was empty. The nodes themselves were working, all the other parts of the website like main menu, footer etc too.
The problem was related to permission issues with drush. Those showed when executing

ddev drush cr

failed with a respective error.

The way to fix this fast, is:

rm -rf vendor 
ddev composer install

 

Tags

Sometimes drush cr does not work. A possible root for the issue could be the shebang

Check the shebang to confirm if the ^M is there:

ddev exec bash -lc 'head -1 vendor/bin/drush | cat -A' 

You should now see:

#!/usr/bin/env php$

If it shows ^M at the end, use Perl to convert CRLF → LF for the wrapper and make it executable:

ddev exec bash -lc "perl -pi -e 's/\r\n/\n/g' vendor/bin/drush && chmod +x vendor/

Tags

composer require drupal/core-recommended:"11.2.5" drupal/core-composer-scaffold:"11.2.5" drupal/core-project-message:"11.2.5" --with-all-dependencies

Tags

ddev composer require drupal/core-recommended:11.2.6 drupal/core-composer-scaffold:11.2.6 drupal/core-project-message:11.2.6 --with-all-dependencies
ddev composer require drupal/core-recommended:11.2.6 drupal/core-composer-scaffold:11.2.6 drupal/core-project-message:11.2.6 --W

unzip /mnt/d/drupal/sites/CUST/projectname/backups/instance/filename.zip -d ~/projects/projectname

or

tar -xf /mnt/d/drupal/sites/CUST/projectname/backups/instance/filename.tar.zip -C ~/projects/projectnam

Tags

# Create a compressed backup
cd ~/projects
tar -czvf ~/projectname-backup-$(date +%F-%H%M).tar.gz projectname

mv ~/projectname-backup-$(date +%F-%H%M).tar.gz /mnt/d/drupal/sites/CUST/projectname/ddev/

# Inside WSL2, export the DB
ddev export-db --file=/tmp/db.sql.gz

mv /tmp/db.sql.gz /mnt/d/drupal/sites/CUST/projectname/ddev/projectname-db-$(date +%F-%H%M).sql.gz

Tags