Managing Drupal with DDEV
Table of Contents
1 DDEV Installation
I followed the official guide here: https://ddev.readthedocs.io/en/stable/#__tabbed_1_4x
1.1 Install mkcert
sudo pacman -S mkcert mkcert -install
1.2 Install 2024-05-15ev
yay -S ddev-bin
2 Docker
2.1 First run docker
On Arch it is the docker.service
.
systemctl start docker.service
2.2 Add non root user to docker group
sudo gpasswd -a ravisagar docker
Logout and login for the changes to take effect
2.3 Check docker status
docker info
3 Install Drupal 10
I followed the official guide here: https://ddev.readthedocs.io/en/stable/users/quickstart/#drupal
mkdir my-drupal-site && cd my-drupal-site
ddev config --project-type=drupal --php-version=8.3 --docroot=web
ddev start
ddev composer create drupal/recommended-project:^10
ddev config --update
ddev composer require drush/drush
ddev drush site:install --account-name=admin --account-pass=admin -y
This will setup and install drupal.
To reset the password you can generate one-time link using the command.
ddev drush uli
Launch the site in your default browser.
ddev launch
You can also find out about your site url.
ddev describe
4 Migrate existing site to ddev
Copy live Drupal 9 site to local directory and also copy the files folder with the database file.xs
From within the directory run the following command.
ddev config --php-version=7.3 --docroot=web
Also, import your Drupal 9 database and start start.
ddev import-db ddev start
This will ask your for a path to your Drupal 9 database sql file.
Then run the following commands.
ddev composer require drush/drush
For running drush I had to do this.
ddev exec drush cr
Not bad.