rdrew
2 years ago
2 changed files with 64 additions and 0 deletions
@ -1,2 +1,3 @@
|
||||
lando_drupal_install.md |
||||
20221011132429.md |
||||
clone_d9_site_for_local_dev.md |
||||
|
@ -0,0 +1,63 @@
|
||||
# Clone d9 site for local dev |
||||
#drupal #lando |
||||
|
||||
### export prod database in project dir |
||||
|
||||
`sudo drush sql-dump --result-file=/var/www/html/libtest/libtest_04_14_2022-17:03.sql` |
||||
|
||||
### copy prod site project dir |
||||
(*need IP and path/to/dir) |
||||
|
||||
`rsync -avz --progress (--dry-run --exclude 'web') rdrew@host_ip:/var/www/html/PATH/TO/DIR .` |
||||
|
||||
### Lando setup |
||||
|
||||
`lando init --recipe drupal9 --source cwd --name PROJECTNAME --webroot ./web` |
||||
`lando start` |
||||
|
||||
(*now have access to drush and composer) |
||||
|
||||
### copy files dir |
||||
|
||||
`mv web/sites/default/files .` |
||||
|
||||
###rm web and vendor |
||||
|
||||
rm -rf web && rm -rf vendor |
||||
|
||||
### rebuild with composer |
||||
|
||||
`lando composer install` |
||||
|
||||
`lando drush site-install` |
||||
|
||||
(* info for this step found by running 'lando info') |
||||
|
||||
### move files dir back |
||||
`rm -rf ./web/sites/default/files` |
||||
|
||||
`mv ./files ./web/sites/default/` |
||||
|
||||
### import prod's db dump |
||||
|
||||
`lando drush sqlc < libtest_04_14_2022-17:03.sql |
||||
`lando drush cr` |
||||
### make drush aliases |
||||
|
||||
`mkdir ./drush/sites && touch ./drush/sites/self.site.yml` |
||||
|
||||
```yaml |
||||
# File: self.site.yml |
||||
local: |
||||
user: rdrew |
||||
root: /Users/rdrew/code/sites/jlmms_project/docroot/ |
||||
dev: |
||||
host: libtest.researchspaces.ca |
||||
user: rdrew |
||||
root: /var/www/html/libtest/web/ |
||||
uri: https://libtest.researchspaces.ca/ |
||||
``` |
||||
### test alias' |
||||
|
||||
`lando drush @dev status` |
||||
|
Loading…
Reference in new issue