Skip to content

dylanblokhuis/wp-pkg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wp-pkg

Simple tool for packaging your WordPress project and database. Ignores non versioned files like node_modules and .git

Installation

$ brew install dylanblokhuis/wp-pkg/wp-pkg

or download the binaries and put them in your $PATH variable

Usage

$ wp-pkg <path>

How to enable search and replace

// wp-config.php
define('DEV_SITE_DOMAIN', 'localhost:3000');
define('PROD_SITE_DOMAIN', 'my-production-site.com');

How to use with Local by Flywheel

Local uses a different mysql socket for each website, to make wp-pkg work you need to specify the path to your mysql socket.

// wp-config.php
define( 'DB_SOCKET', '/Users/<user>/Library/Application Support/Local/run/<site_id>/mysql/mysqld.sock' );

Screenshot showcasing the Local by Flywheel database socket location

Roadmap

  • zips the wp-content folder with ignoring things like node_modules/.git etc ✔️
  • uses the wp-config file to export the database ✔️
  • search and replace the serialized stuff ✔️