DDEV

✅ 1. Stop the project first

ddev stop

✅ 2. Clean the project directory (files)

rm -rf ~/projects/projectname/*

or

rm -rf web/ vendor/ composer.json composer.lock


check if .ddev is still present
ls -a

✅ 3. Extract production files

unzip /mnt/d/drupal/sites/CUST/customer/projectname.zip -d ~/projects/projectname
or
tar -xvzf /mnt/d/drupal/sites/CUST/customer/projectname.tar.gz -C ~/projects/projectname

✅ 4. Start DDEV

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
tar -czvf ~/projectname-backup-$(date +%F-%H%M).tar.gz -C projectname .
tar -czvf ~/projectname-backup-$(date +%F-%H%M).tar.gz \
 -C ~/projects/projectname \
 web vendor composer.json composer.lock   
 

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

Tags