Browse Source

[nb] Add: clone_d9_site_for_local_dev.md

master
rdrew 2 years ago
parent
commit
f4e1a7307a
  1. 1
      .index
  2. 63
      clone_d9_site_for_local_dev.md

1
.index

@ -1,2 +1,3 @@
lando_drupal_install.md lando_drupal_install.md
20221011132429.md 20221011132429.md
clone_d9_site_for_local_dev.md

63
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…
Cancel
Save