Having Problems with Drupal, Lando, and Pantheon?
July 28, 2024
I just spent forever trying to pull a new Drupal 10 website repo from Pantheon and get it running locally with Lando. Brutal. I’m documenting my path in hopes it helps some person some day, which started with this Reddit post: Problem getting Lando set up with Pantheon.
Steps to Get Your Drupal Site Running Locally with Lando and Pantheon:
- Clone the Site from Pantheon:
git clone <pantheon-repo-url>
This command clones the repository from Pantheon to your local machine. - Initialize Lando:
lando init
- Do not select Pantheon as your environment.
- Select the working path where you pulled the site.
- For the second option, select Pantheon.
- Start Lando:
lando start
This command starts the Lando environment for your site. - Pull the Database and Files:
lando pull
This command pulls the database and files from Pantheon. (This step WILL fail due to database access issues.) - Destroy the Current Environment:
lando destroy
This command destroys the current Lando environment, which can help resolve issues with database access. - Rebuild the Environment:
lando start
This command starts the Lando environment again, which should rebuild the database correctly. - Pull the Database and Files Again:
lando pull
This command pulls the database and files from Pantheon again, which should now be successful. - Clear All Caches:
lando drush cr
This command clears all caches, which can help resolve errors and stability issues. If you haven’t you may need to install Drush first with this commandlando composer require drush/drush
Now, if you’re lucky, the gods have smiled upon you and you have a running site. Hoping to see this updated in the Pantheon docs or the Lando recipe updated sooner than later.
Uncategorized