Skip to content

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

  1. Log in to the WordPress staging environment
  2. Navigate to Tools > WP Migrate in the WordPress admin
  3. Go to Settings tab
  4. Copy the connection information

The connection info format is: https://domain.lamalama.dev <connection-key> (space-separated)

Process

The command performs these steps:

  1. Creates a new directory for the project
  2. Downloads and installs WordPress
  3. Creates a local database
  4. Installs WP Migrate DB Pro
  5. Clones the theme repository
  6. Pulls database and files from staging
  7. Replaces staging URLs with local URLs
  8. 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_url option 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

Released under the MIT License.