Appearance
Pull Staging Environment
The staging:pull command downloads a staging environment to your local machine. This command downloads the database, files, and media from a staging environment and sets up a local copy.
Usage
bash
clli staging:pull <connection-info>Arguments
connection-info(required) - WP Migrate DB Pro connection information from the staging environment
Options
-r, --repository_url- Overwrite the git clone URL for the repository- Use this if the repository name differs from the subdomain
Getting Connection Info
- Log in to the WordPress staging environment
- Navigate to Tools > WP Migrate in the WordPress admin
- Go to Settings tab
- Copy the connection information
The connection info format is: https://domain.lamalama.dev <connection-key> (space-separated)
Process
The command performs these steps:
- Creates a new directory for the project
- Downloads and installs WordPress
- Creates a local database
- Installs WP Migrate DB Pro
- Clones the theme repository
- Pulls database and files from staging
- Replaces staging URLs with local URLs
- Installs dependencies and builds assets
Examples
Basic usage:
bash
clli staging:pull "https://projectx.lamalama.dev qQSr+EVrJ83uIkME/zQiCBb4V/nVaG1dzh5vmqEq"With custom repository URL:
bash
clli staging:pull "https://projectx.lamalama.dev qQSr+EVrJ83uIkME/zQiCBb4V/nVaG1dzh5vmqEq" --repository_url="git@github.com:lamalamaNL/custom-repo.git"Tips
- If the command fails, remove the created directory and run it again after fixing the issue
- The command may take some time, especially with large databases or many media files
- Ensure you have enough disk space for the staging environment
Troubleshooting
Connection Fails
Connection fails:
- Verify the connection info is correct
- Check that WP Migrate DB Pro is up to date on staging
- Ensure the staging site is accessible
Repository clone fails:
- Check your Git access to the repository
- Use
--repository_urloption if the repo name differs - Verify SSH keys are set up correctly
Database import fails:
- Check database credentials
- Ensure local MySQL is running
- Verify you have enough disk space
Related Documentation
- Create Staging Environment - Creating staging environments
- Configuration - Setting up credentials for staging
- CLLI Overview - Introduction to CLLI