I'm using DDEV for local Drupal 9 development and it's great. Now, for the first time ever, I'm trying to take a local site and put it on my hosted server, which is an absolutely normal Linux and cPanel based hosting service. I "get" the basic procedure, but I can't get the "last few yards" down. I "get" this:
- export the local DDEV database with ddev export-db
- import it through cPanel on the remote server, say with phpAdmin
- export all the files, say as a tar.gz
- upload to cPanel, and put them all in the root directory
But beyond this, I'm rather stuck, and I know there is more to do. In particular, I know I have to modify settings.php. But I know that in the local environment, DDEV manages it and makes its own file, etc. but I'm just not clear on exactly what I have to do here without breaking the whole thing.
And of course I don't know whether are additional things I have to also do to tweak the site to get up and running.
Obviously many have done this, so could somebody point me to maybe some write-up that somebody might have done?
Thanks!
Great question!
DDEV-Local doesn't actually want to generate a settings.php for you, it would rather just add the include of settings.ddev.php to your existing settings.php.
The easiest thing to do is to copy default.settings.php to settings.php (just overwrite the settings.php that ddev created) and then do a
ddev start
. ddev will then add the include of settings.ddev.php and everything should go smoothly.From there:
Note: DDEV-Local v1.16+ (currently in alpha) does use default.settings.php as the base for the generated settings.php.