Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Bash scripting that extracts production WordPress websites and updates their local versions in my computer. Designed to run on a MacBook.

How to Use


  1. Requires bash 5
  2. Requires sshpass if you choose to use ssh passwords instead of key files.


  1. Download and this file
  2. Create a configuration file example.conf for each local and production website pair. Use the sample file contents below.
  3. Change the email address on line 28 to your email address. Consider using a command like sed -i '' -e "s|||g"
  4. Navigate to the directory that contains and your configuration files in Terminal
  5. Type bash or bash example to skip the prompt asking which configuration file should be loaded
  6. Enter q at any prompt to abort the program

Sample Configuration File

Create a file in the same directory as named example.conf and change all the example values to match your local and production environments. An explanation of each variable in the config file can be found below the sample.

declare -A SITE=(







export SSHPASS="${SITE[ssh_password]}"

Explanation of Config File Variables

  • ssh_user_at_host The SSH user name and host separated by @.
  • ssh_port The port number where SSH is available. 58134
  • ssh_password The SSH user password. See SSH Authentication notes below. o0o00oo0oo00o0o
  • ssh_remote_key_file The name of a file containing an SSH private key. SSH Authentication notes below. example
  • production_mysql_database The name of the database on the remote server. breakfastco
  • production_mysql_user The name of the user with permission to query the remote database. user_name
  • production_mysql_password The remote database user's password. 66g6gggg6g66g
  • local_mysql_database The name of the database on the local server. wp_breakfastco
  • local_mysql_user The name of the user with permission to query the local database. root
  • local_mysql_password The local database user's password root
  • production_domain The remote site's domain including subdomain and starting with ://. Used to change all URLs stored in the database, including the siteurl in the options table. ://
  • local_domain The local site's domain including subdomain. ://example.test
  • production_path Full path to the WordPress root folder on the remote server. /path/public_html/
  • local_path Full path to the WordPress root folder on the local server. /Users/user/Sites/example/
  • production_root_path Full path to the user's home directory we land in when connecting to the server via SSH. Sometimes does not like a preceding slash. /path/
  • script_after Optional. Script to run after the local copy of the site is updated. wp user create corey --role=administrator

SSH Authentication

This script supports both password and public key SSH authentication. To use a password, provide it in ssh_password. Register an SSH private key file using a command like ssh-add /Users/{user-name}/{...}/privatekeyfilename before running exfil, and provide the private key file name in ssh_remote_key_file.



  • Added Now detects a $table_prefix mismatch and edits the local wp-config.php to match remote


  • Added Now checks for the WP Engine mysql.sql file when mysqldump fails


  • Added Adds a .conf file variable script_after to hold scripting that will be run in the local site's directory after the local site is updated.


  • Added Accepts q at any prompt to abort the program.
  • Added If the Gravity Forms plugin is active, exfil now activates or installs and activates the Power Boost for Gravity Forms plugin.
  • Added Deactivates SiteGround's SG Optimizer plugin if it is active.
  • Added Installs and activates the Stop Emails plugin if it is not found to be active.
  • Fixed Specify a full path when saving the .sql backup file on the server so we can predict where to find it.
  • Changed Asks whether to delete the downloaded .sql file after importing it before starting the import. This puts all questions at the beginning, and lets the program exit instead of sitting on this question if the user turns their attention away while the import is running.


  • Fixed Now checks that the specified .conf file exists before trying to load it. If the file does not exist, delivers an error message and aborts the program.


  • Added Adds the GPL 2 license file
  • Added Adds instructions to change the email address used to overwrite the admin email
  • Changed Changes the file download feature to present a menu with five choices instead of just yes/no on the whole wp-content folder


  • Changed Now suppresses the server's welcome message during ssh connections for cleaner output
  • Changed Skips loading plugins and themes when running WP CLI commands for cleaner output
  • Changed Downloading the wp-content folder is now optional
  • Fixed The delete local .sql files feature now works


  • Added Now downloads the wp-content directory


  • Fixed Edits all ssh commands to add option -o StrictHostKeyChecking=no. This prevents the prompt Are you sure you want to continue connecting (yes/no)? from disrupting the first call to ssh. I had been manually connecting with ssh prior to using this script to answer yes to the prompt, and this version eliminates that step by always trusting the host keys.


First version that supports both SSH password and public key authentication methods.

  • Added Adds this change log to
  • Removed Removes duplicate credentials in configuration files


Bash script. Extracts WordPress databases and files.







No releases published


No packages published