2

I've got a craft cms 4 website that I've been developing locally on my old PC and I've also got hosted with Servd Host. I've just got a new mac and I'm trying to get my project running locally on it but running into some problems. Here's what I've done:

  • Installed Docker
  • Installed PHP
  • Installed DDVEV
  • Cloned the repository
  • Ran composer install and composer dump-autoload
  • Ran ddev config --project-type=craftcms
  • Ran ddev start

I'm getting the following error (see screenshot). Any ideas what's causing it and how to fix? I'm fairly new to Craft so don't really understand this side of things.

enter image description here

1 Answer 1

2

That error is likely due to Craft not being installed yet (it’s Composer-installed but not… Craft-installed), because your local DDEV database is empty.

Either

  • (Recommended) Dump the database from another environment (preferably production) using your method of choice (you can even download a database backup from Craft’s CP in production via the Utilities section), and import it to your local DDEV site by running ddev import-db
  • …or, install a “fresh” version of the site locally by running ddev craft install (or ddev exec php craft install if you’re not using the “craftcms” DDEV project type). The install should have the same schema (ie sections, fields etc) as your production site, but will be completely empty in terms of content.
3
  • 1
    I thought it would be something simple like that! Thanks so much! Commented Jul 11, 2023 at 17:03
  • I would actually recommend the second approach. Spin up the site with no seed database, just with all structures in place. Load up the frontend and see if you get any errors. Create some demo content and see if everything works as intended without existing contents in place. We do this at work, every developer has their own dev environment with at best some starter contents created through a migration, and we only rarely pull in the live DB for debugging or testing. Great way to see if you've coded defensively enough - if you get errors, good opportunity to improve on that.
    – MoritzLost
    Commented Jul 11, 2023 at 18:57
  • 1
    Relatively minor point but this part of your initial install: Installed PHP was not necessary or useful - the point of DDEV is that it contains/manages all the dependencies (PHP version, DB etc) - i.e. if you look in your .ddev.config.yaml you will see e.g. php_version: "8.2" - meaning that ddev project will use PHP8.2. You might have some other project using, e.g. PHP 7.4 or whatever. Generally the best thing is to keep your computer free of such things at the 'outside of ddev' level so that each project is self contained with all its versions/dependencies. Commented Jul 13, 2023 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.