Alternative Lagoon File Transfer Runbook¶
Overview¶
This runbook provides alternative instructions for transferring files from Lagoon environments to local development when the Lagoon UI backup feature fails. This is particularly useful for webmaster libraries that depend on module files being available locally. The regular way of transferring files is described in this document.
When to Use This Runbook¶
- Need to download files from a Lagoon environment to local development
- Setting up a webmaster library locally that requires module files
- Manual file synchronization between environments
Prerequisites¶
- Lagoon CLI installed and configured
- SSH access to the target Lagoon project
Step-by-Step Procedure¶
Step 1: Connect to Lagoon Environment¶
- Open terminal
- Connect to the target project's SSH environment:
Replace [project]
with the actual project name
Step 2: Create Archive of Files¶
Choose one of the following options based on your needs:
Option A: All Site Files¶
Option B: Drupal Modules Only¶
Replace [project]
with your project name for consistent naming.
Step 3: Exit SSH Session¶
Or use keyboard shortcut: Ctrl + D
Step 4: Get SSH Connection String¶
- Retrieve the SSH connection details:
- Note the connection string format:
[project]-[environment]@[ip]
Step 5: Transfer Files Using SCP¶
- Use SCP to copy the archive to your local machine:
Step 6: Extract Files Locally¶
- Navigate to the temporary directory:
- Extract the archive:
Step 7: Copy Files to Project¶
- Navigate to your local project directory
- Copy the necessary files to your project's
web/sites/default/files/
directory:
Example Walkthrough¶
For a project called "skanderborg":
# Step 2: Create archive (modules only)
tar -cvzf /tmp/skanderborg_files_modules.tar.gz /app/web/sites/default/files/modules_local
```bash
# Step 3: Exit SSH
exit
```bash
# Step 4: Get connection string
lagoon ssh -p skanderborg -e main --conn-string
# Step 5: Transfer files
scp skanderborg-main@ssh.lagoon.amazeeio.cloud:/tmp/skanderborg_files_modules.tar.gz/tmp/
# Step 7: Copy to project
cp -r /tmp/app/web/sites/default/files/modules_local/* ./web/sites/default/files/modules_local/
Troubleshooting¶
Issue: SSH Connection Failed¶
The lagoon ssh
command fails occasionally. Usually it is in the ssh handshake
phase. Just run the command again until it succeeds.