You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.3 KiB

# 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`