Local configuration

Edited 2 years 8 months ago

After install Lando follow these steps:

 

ADD NEW SITE

 

1. Add site brand to the files lando.yml and sites.local.php following the pattern in each file, and save.

 

Configure .lando.yml

 

 

Configure sites.local.php, following the structure defined by Acquia for sites using Site Factory

 

 

 

 

 2. Go to the terminal and start Lando

 

lando start

 

3. Create the site using Lando

 

lando site-create <brand>

 

This helper tool will create some directories and drush aliases with choosen site, this brand name needs to follow the same rule as explained in the begining of this guide.

 

4. Register your local URL in your /etc/hosts

 

sudo bash -c 'echo "127.0.0.1 local.<brand>.com" >> /etc/hosts'

 

If you use Windows, this file is in C:\Windows\System32\drivers\etc folder.

 

Remember, replace  <brand> by your site name.

 

5. Restart your containers

 

lando restart

 

RESTORE NEW SITE FILES AND DATABASE 

 

 

1. Rebuild the site

 

lando rebuild

 

2. If you has permission to connect Acquia SSH, you can copy the production database for your site.

 

lando drush sql:sync @<brand>.01live @<brand>.local --debug  

 

lando drush rsync @<brand>.01live:%files @<brand>.local:%files --debug

 

If not, follow this documentation to create a site backup.

 

3. Extract the GZip file

 

tar -xvf <download-path>/<backup-file>.tar.gz

 

4. Move files from backup folder to your site folder

 

mv <extract-path>/docroot/sites/default/files docroot/sites/<brand>/files

 

   4.1. If you want, you can give the folder files total access to avoid future problems with permissions.

 

sudo chmod -R 777 ./docroot/sites/<brand>/files

 

5. Import database from extracted backup file and paste to the main folder

 

lando drush @<brand>.local sqlc < database.sql

 

ACCESSING THE SITE AFTER RESTORATION

 

 

1. Install all dependencies

 

lando composer install

 

2. Rebuild the site and flush the cache

 

lando drush @<brand>.local cache:rebuild

 

3. Generate link for admin new access

 

lando drush @<brand>.local uli

 

 Your local environment is ready. ?

 

 

 

 

 

If you have access to Acquia Site Factory you can backup your site here.