SlideShare a Scribd company logo
Configuration Management in WordPress
1. Intro
2. Data and WordPress & Configuration
3. Sync Codebase
4. Sync Uploads
5. Sync Database
6. Configuration Management
Agenda
•Sales Engineer - WP Engine
•Developer, Freelancer
•CMS Specialist
•Open Source
•Speaker
Edmund Turbin
WordCamp Stockholm - Nov 2016
Data and WordPress
&
Configuration
CONFIGURATION MANAGEMENT
The task of tracking and controlling
changes in the software
DATA AND WORDPRESS
• Core, plugin and theme files
• Data stored in a MySQL db
• Options/Transients/Object Caching
• Media Library assets and files
• Configuration wp-config.php
WHAT DATA DOES WORDPRESS USE?
DATA AND WORDPRESS
“Configuration varies across deploys,
code stays the same”
DATA AND WORDPRESS
• Database
• Files
• Uploads
WHAT DATA IS NEEDED FOR DEPLOYMENT?
DATA AND WORDPRESS
• wp-config.php - keeps site specific configuration
• Different when using multiple dev environments
• Has sensitive information
CONFIGURATION
DATA AND WORDPRESS
• Some settings apply to all environments
• Each environment has unique settings
• Credentials will be different each environment
• Keep credentials out of version control
CONFIGURATION WITH MULTIPLE ENVIRONMENTS
DATA AND WORDPRESS
• Allows you to keep variations of your wp-config.php
• Each environment has it’s own unique config
• Uses variables to include proper configuration file
DOTENV
https://m.dotdev.co/secure-your-wordpress-config-with-dotenv-d939fcb06e24
Sync Codebase
DEPLOYMENT
• SFTP/FTP
• Version Control - GIT, SVN
SYNC CODEBASE
DEPLOYMENT
• Version Control allows you to be sure that all changes are
pushed to environments
•Can ignore files and directories that are not needed
SYNC CODEBASE
Sync Uploads
DEPLOYMENT
• Typically not stored in version control
• Files can be large
• Will not change very much
UPLOADS DIRECTORY
DEPLOYMENT
• Copy all files
• Copy files you need
• Point to files on another server
SYNC UPLOADS METHODS
DEPLOYMENT
• FTP can be used to copy the entire uploads directory
• Can be done with client app
COPY ALL FILES
DEPLOYMENT
• rsync -avz --rsh=ssh user@host:/path/to/wp-content/uploads/* .
• Requires SSH some command line chops
• Not available on all hosting providers
COPY ALL FILES - RSYNC
DEPLOYMENT
• FTP can be used to copy only recent files
• WordPress organizes uploads by date if configured
COPY SOME FILES
DEPLOYMENT
COPY SOME FILES
PLUGIN: UPLOADS BY PROXY
https://wordpress.org/plugins/uploads-by-proxy/
PLUGIN: UPLOADS BY PROXY
WP-CONFIG.PHP SETTINGS
https://wordpress.org/plugins/uploads-by-proxy/
//** Uploads by Proxy */
define('WP_SITEURL', 'http://edmund.local');
define('UBP_IS_LOCAL', true);
define('UBP_SITEURL', 'http://www.edmundturbin.com');
Database Migration
DATA IN WORDPRESS
• WP-CLI
• SFTP/FTP & mysql import
• 3rd party plugins
MOVE DATABASE EXPORT ACROSS ENVIRONMENTS
DATABASE MIGRATION
• WP-CLI
• MySQL import
• PHPMyAdmin
DATABASE IMPORT
DATABASE MIGRATION
• Allow you to run remote wp-cli commands
• Connects via SSH behind the scenes
• @dev, @stage, @production
• Uses a prefix before wp-cli command
• wp @dev cli info
WP-CLI ALIASES
DATABASE MIGRATION
• wp @production db export > production_db_export.sql
• wp @dev db reset —yes
•wp @dev db import production_db_export.sql
• wp @dev search-replace example.com example.dev
SYNC DATABASE ACROSS ENVIRONMENTS
https://gist.github.com/retlehs/aa47003249623e52b95a3fcd6f69b8fb#file-sync-prod-sh
Configuration
Management
CONFIGURATION MANAGEMENT
• Save time by transferring only what we need
• Less data to be transferred
• Data does not need to be synced
WHAT IF WE ONLY NEED TO MAKE A FEW CHANGES?
CONFIGURATION MANAGEMENT
• Settings are unique - site_url, home_url
• Not all plugins are needed on production
• Site admins or user can make settings changes
WHAT IF SETTINGS ARE DIFFERENT IN EACH ENVIRONMENT?
PLUGIN: WP-CFM
https://wordpress.org/plugins/wp-cfm/
PLUGIN: WP-CFM
• Copy settings that you need, not entire DB
• Keep track of all settings in a single place
• Version Control
• Manage multiple environments
https://wordpress.org/plugins/wp-cfm/
BENEFITS
PLUGIN: WP-CFM
• Allows you to save options
• Can be saved as sets called Bundles
• Push changes to file
• Pull changes into database
https://wordpress.org/plugins/wp-cfm/
HOW DOES IT WORK?
PLUGIN: WP-CFM
• Data saved to disk as JSON array
• Can be committed to a repo
• Changes managed in WP Dashboard
• Permissions on settings?
https://wordpress.org/plugins/wp-cfm/
WORDPRESS CONFIGURATION MANAGEMENT
PLUGIN: WP-CFM
• WP settings (wp_options table)
• Multisite settings (wp_sitemeta table)
• Taxonomy terms
• Custom Field Suite field groups
https://wordpress.org/plugins/wp-cfm/
WHAT DATA CAN BE MANAGED?
PLUGIN: WP-CFM
wp config pull [bundle_name]
wp config push [bundle_name]
wp config diff [bundle_name]
wp config bundles
wp config show_bundle [bundle_name]
https://wordpress.org/plugins/wp-cfm/
WP-CLI COMMANDS
Codebase & Uploads
Version control ensures your
codebase is synced. Uploads
pulled down regularly
WP-CLI for DB Sync
WP-CLI can make it simple to keep
your content in sync across
multiple environments
Configuration
Can differ across different tiers,
but can still be managed centrally
within codebase.
Thank you!
@spicecadet
edmund.turbin@wpengine.com

More Related Content

What's hot

MES102 - Verse on Premises 2.0 Best Practices
MES102 - Verse on Premises 2.0 Best PracticesMES102 - Verse on Premises 2.0 Best Practices
MES102 - Verse on Premises 2.0 Best Practices
Dylan Redfield
 
Serve like a boss (part one)
Serve like a boss (part one)Serve like a boss (part one)
Serve like a boss (part one)
Hamed Nemati
 
WordPress Workflows
WordPress WorkflowsWordPress Workflows
WordPress Workflows
Phill Brown
 
What's new in MySQL 5.5? FOSDEM 2011
What's new in MySQL 5.5? FOSDEM 2011What's new in MySQL 5.5? FOSDEM 2011
What's new in MySQL 5.5? FOSDEM 2011
Lenz Grimmer
 
Magento caching
Magento cachingMagento caching
Magento caching
Yireo
 
HCL Sametime V11 installation - tips
HCL Sametime V11 installation - tipsHCL Sametime V11 installation - tips
HCL Sametime V11 installation - tips
Ales Lichtenberg
 
Upgrading or migrating to a higher AEM version - Planning and process
Upgrading or migrating to a higher AEM version - Planning and processUpgrading or migrating to a higher AEM version - Planning and process
Upgrading or migrating to a higher AEM version - Planning and process
Ashokkumar T A
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with Nginx
Bud Siddhisena
 
Debugging the Web with Fiddler
Debugging the Web with FiddlerDebugging the Web with Fiddler
Debugging the Web with Fiddler
Ido Flatow
 
Best And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsBest And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM Connections
LetsConnect
 
Linux Servers
Linux ServersLinux Servers
Linux Servers
Ranjith Siji
 
Speeding Up The Snail
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The Snail
Marcus Deglos
 
What's New in Notes, Sametime and Verse On-Premises
What's New in Notes, Sametime and Verse On-PremisesWhat's New in Notes, Sametime and Verse On-Premises
What's New in Notes, Sametime and Verse On-Premises
Gabriella Davis
 
HCL Sametime V11 - ENG
HCL Sametime V11 - ENGHCL Sametime V11 - ENG
HCL Sametime V11 - ENG
Ales Lichtenberg
 
Caching strategies with lucee
Caching strategies with luceeCaching strategies with lucee
Caching strategies with lucee
Gert Franz
 
Setting up a local WordPress Environment
Setting up a local WordPress EnvironmentSetting up a local WordPress Environment
Setting up a local WordPress Environment
Chris La Nauze
 
INF107 - Integrating HCL Domino and Microsoft 365
INF107 - Integrating HCL Domino and Microsoft 365INF107 - Integrating HCL Domino and Microsoft 365
INF107 - Integrating HCL Domino and Microsoft 365
Dylan Redfield
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...
ColdFusionConference
 
Advanced Akeeba Backup (Joomla! Day Denmark 2012)
Advanced Akeeba Backup (Joomla! Day Denmark 2012)Advanced Akeeba Backup (Joomla! Day Denmark 2012)
Advanced Akeeba Backup (Joomla! Day Denmark 2012)
Nicholas Dionysopoulos
 
Lucee writing your own debugging template
Lucee   writing your own debugging templateLucee   writing your own debugging template
Lucee writing your own debugging template
Gert Franz
 

What's hot (20)

MES102 - Verse on Premises 2.0 Best Practices
MES102 - Verse on Premises 2.0 Best PracticesMES102 - Verse on Premises 2.0 Best Practices
MES102 - Verse on Premises 2.0 Best Practices
 
Serve like a boss (part one)
Serve like a boss (part one)Serve like a boss (part one)
Serve like a boss (part one)
 
WordPress Workflows
WordPress WorkflowsWordPress Workflows
WordPress Workflows
 
What's new in MySQL 5.5? FOSDEM 2011
What's new in MySQL 5.5? FOSDEM 2011What's new in MySQL 5.5? FOSDEM 2011
What's new in MySQL 5.5? FOSDEM 2011
 
Magento caching
Magento cachingMagento caching
Magento caching
 
HCL Sametime V11 installation - tips
HCL Sametime V11 installation - tipsHCL Sametime V11 installation - tips
HCL Sametime V11 installation - tips
 
Upgrading or migrating to a higher AEM version - Planning and process
Upgrading or migrating to a higher AEM version - Planning and processUpgrading or migrating to a higher AEM version - Planning and process
Upgrading or migrating to a higher AEM version - Planning and process
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with Nginx
 
Debugging the Web with Fiddler
Debugging the Web with FiddlerDebugging the Web with Fiddler
Debugging the Web with Fiddler
 
Best And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsBest And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM Connections
 
Linux Servers
Linux ServersLinux Servers
Linux Servers
 
Speeding Up The Snail
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The Snail
 
What's New in Notes, Sametime and Verse On-Premises
What's New in Notes, Sametime and Verse On-PremisesWhat's New in Notes, Sametime and Verse On-Premises
What's New in Notes, Sametime and Verse On-Premises
 
HCL Sametime V11 - ENG
HCL Sametime V11 - ENGHCL Sametime V11 - ENG
HCL Sametime V11 - ENG
 
Caching strategies with lucee
Caching strategies with luceeCaching strategies with lucee
Caching strategies with lucee
 
Setting up a local WordPress Environment
Setting up a local WordPress EnvironmentSetting up a local WordPress Environment
Setting up a local WordPress Environment
 
INF107 - Integrating HCL Domino and Microsoft 365
INF107 - Integrating HCL Domino and Microsoft 365INF107 - Integrating HCL Domino and Microsoft 365
INF107 - Integrating HCL Domino and Microsoft 365
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...
 
Advanced Akeeba Backup (Joomla! Day Denmark 2012)
Advanced Akeeba Backup (Joomla! Day Denmark 2012)Advanced Akeeba Backup (Joomla! Day Denmark 2012)
Advanced Akeeba Backup (Joomla! Day Denmark 2012)
 
Lucee writing your own debugging template
Lucee   writing your own debugging templateLucee   writing your own debugging template
Lucee writing your own debugging template
 

Similar to Configuration Management in WordPress

wp-config Tips and Tricks
wp-config Tips and Trickswp-config Tips and Tricks
wp-config Tips and Tricks
Josh Harrison
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011
Bachkoutou Toutou
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
Ohad Raz
 
Managing Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large NetworkManaging Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large Network
William Earnhardt
 
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
rtCamp
 
be the captain of your connections deployment
be the captain of your connections deploymentbe the captain of your connections deployment
be the captain of your connections deployment
Sharon James
 
SolarWinds Federal User Group 2016 - Optimizing SolarWinds Orion
SolarWinds Federal User Group 2016 - Optimizing SolarWinds OrionSolarWinds Federal User Group 2016 - Optimizing SolarWinds Orion
SolarWinds Federal User Group 2016 - Optimizing SolarWinds Orion
SolarWinds
 
WP-MU 101: How to Install and Avoid Common Mistakes
WP-MU 101: How to Install and Avoid Common MistakesWP-MU 101: How to Install and Avoid Common Mistakes
WP-MU 101: How to Install and Avoid Common Mistakes
CT Moore
 
Instant ColdFusion with Vagrant
Instant ColdFusion with VagrantInstant ColdFusion with Vagrant
Instant ColdFusion with Vagrant
ColdFusionConference
 
Updating WordPress Themes, Plugins, and Core Safely
Updating WordPress Themes, Plugins, and Core SafelyUpdating WordPress Themes, Plugins, and Core Safely
Updating WordPress Themes, Plugins, and Core Safely
Angela Bowman
 
WordPress Hosting Best Practices - Do's and Don't s | WordPress Trivandrum
WordPress Hosting Best Practices - Do's and Don't s  | WordPress TrivandrumWordPress Hosting Best Practices - Do's and Don't s  | WordPress Trivandrum
WordPress Hosting Best Practices - Do's and Don't s | WordPress Trivandrum
WordPress Trivandrum
 
Deployment and Management of Hadoop Clusters
Deployment and Management of Hadoop ClustersDeployment and Management of Hadoop Clusters
Deployment and Management of Hadoop Clusters
Amal G Jose
 
NGINX: Basics and Best Practices
NGINX: Basics and Best PracticesNGINX: Basics and Best Practices
NGINX: Basics and Best Practices
NGINX, Inc.
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
Luis Rodríguez Castromil
 
January OpenNTF Webinar - Backup your Domino Server - New Options in V12
January OpenNTF Webinar - Backup your Domino Server - New Options in V12January OpenNTF Webinar - Backup your Domino Server - New Options in V12
January OpenNTF Webinar - Backup your Domino Server - New Options in V12
Howard Greenberg
 
OpenStack Summit 2013 Hong Kong - OpenStack and Windows
OpenStack Summit 2013 Hong Kong - OpenStack and WindowsOpenStack Summit 2013 Hong Kong - OpenStack and Windows
OpenStack Summit 2013 Hong Kong - OpenStack and Windows
Alessandro Pilotti
 
Soccnx10: Best and worst practices deploying IBM Connections
Soccnx10: Best and worst practices deploying IBM ConnectionsSoccnx10: Best and worst practices deploying IBM Connections
Soccnx10: Best and worst practices deploying IBM Connections
panagenda
 
Week6 office-hours
Week6 office-hoursWeek6 office-hours
Week6 office-hours
Randall Rode
 
Instant ColdFusion with Vagrant
Instant ColdFusion with VagrantInstant ColdFusion with Vagrant
Instant ColdFusion with Vagrant
ColdFusionConference
 
No more “cowboy coding”
No more “cowboy coding”No more “cowboy coding”
No more “cowboy coding”
Jim True
 

Similar to Configuration Management in WordPress (20)

wp-config Tips and Tricks
wp-config Tips and Trickswp-config Tips and Tricks
wp-config Tips and Tricks
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
 
Managing Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large NetworkManaging Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large Network
 
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
 
be the captain of your connections deployment
be the captain of your connections deploymentbe the captain of your connections deployment
be the captain of your connections deployment
 
SolarWinds Federal User Group 2016 - Optimizing SolarWinds Orion
SolarWinds Federal User Group 2016 - Optimizing SolarWinds OrionSolarWinds Federal User Group 2016 - Optimizing SolarWinds Orion
SolarWinds Federal User Group 2016 - Optimizing SolarWinds Orion
 
WP-MU 101: How to Install and Avoid Common Mistakes
WP-MU 101: How to Install and Avoid Common MistakesWP-MU 101: How to Install and Avoid Common Mistakes
WP-MU 101: How to Install and Avoid Common Mistakes
 
Instant ColdFusion with Vagrant
Instant ColdFusion with VagrantInstant ColdFusion with Vagrant
Instant ColdFusion with Vagrant
 
Updating WordPress Themes, Plugins, and Core Safely
Updating WordPress Themes, Plugins, and Core SafelyUpdating WordPress Themes, Plugins, and Core Safely
Updating WordPress Themes, Plugins, and Core Safely
 
WordPress Hosting Best Practices - Do's and Don't s | WordPress Trivandrum
WordPress Hosting Best Practices - Do's and Don't s  | WordPress TrivandrumWordPress Hosting Best Practices - Do's and Don't s  | WordPress Trivandrum
WordPress Hosting Best Practices - Do's and Don't s | WordPress Trivandrum
 
Deployment and Management of Hadoop Clusters
Deployment and Management of Hadoop ClustersDeployment and Management of Hadoop Clusters
Deployment and Management of Hadoop Clusters
 
NGINX: Basics and Best Practices
NGINX: Basics and Best PracticesNGINX: Basics and Best Practices
NGINX: Basics and Best Practices
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
 
January OpenNTF Webinar - Backup your Domino Server - New Options in V12
January OpenNTF Webinar - Backup your Domino Server - New Options in V12January OpenNTF Webinar - Backup your Domino Server - New Options in V12
January OpenNTF Webinar - Backup your Domino Server - New Options in V12
 
OpenStack Summit 2013 Hong Kong - OpenStack and Windows
OpenStack Summit 2013 Hong Kong - OpenStack and WindowsOpenStack Summit 2013 Hong Kong - OpenStack and Windows
OpenStack Summit 2013 Hong Kong - OpenStack and Windows
 
Soccnx10: Best and worst practices deploying IBM Connections
Soccnx10: Best and worst practices deploying IBM ConnectionsSoccnx10: Best and worst practices deploying IBM Connections
Soccnx10: Best and worst practices deploying IBM Connections
 
Week6 office-hours
Week6 office-hoursWeek6 office-hours
Week6 office-hours
 
Instant ColdFusion with Vagrant
Instant ColdFusion with VagrantInstant ColdFusion with Vagrant
Instant ColdFusion with Vagrant
 
No more “cowboy coding”
No more “cowboy coding”No more “cowboy coding”
No more “cowboy coding”
 

More from Edmund Turbin

Remote Control WordPress
Remote Control WordPressRemote Control WordPress
Remote Control WordPress
Edmund Turbin
 
Production Ready WordPress #WPLDN
Production Ready WordPress #WPLDNProduction Ready WordPress #WPLDN
Production Ready WordPress #WPLDN
Edmund Turbin
 
Production Ready WordPress - WC Utrecht 2017
Production Ready WordPress  - WC Utrecht 2017Production Ready WordPress  - WC Utrecht 2017
Production Ready WordPress - WC Utrecht 2017
Edmund Turbin
 
Production ready word press
Production ready word pressProduction ready word press
Production ready word press
Edmund Turbin
 
The Themer's Guide to WP-CLI
The Themer's Guide to WP-CLIThe Themer's Guide to WP-CLI
The Themer's Guide to WP-CLI
Edmund Turbin
 
The Themer's Guide to WP-CLI
The Themer's Guide to WP-CLIThe Themer's Guide to WP-CLI
The Themer's Guide to WP-CLI
Edmund Turbin
 
Customize it.
Customize it.Customize it.
Customize it.
Edmund Turbin
 
Theming in WordPress - Where do I Start?
Theming in WordPress - Where do I Start?Theming in WordPress - Where do I Start?
Theming in WordPress - Where do I Start?
Edmund Turbin
 
Word press gets responsive 4x3
Word press gets responsive 4x3Word press gets responsive 4x3
Word press gets responsive 4x3
Edmund Turbin
 
Scaling WooCommerce on WP Engine
Scaling WooCommerce on WP EngineScaling WooCommerce on WP Engine
Scaling WooCommerce on WP Engine
Edmund Turbin
 
Working in Harmony: Manchester - Optimize development and content workflows
Working in Harmony: Manchester - Optimize development and content workflowsWorking in Harmony: Manchester - Optimize development and content workflows
Working in Harmony: Manchester - Optimize development and content workflows
Edmund Turbin
 
Working in harmony
Working in harmonyWorking in harmony
Working in harmony
Edmund Turbin
 
Woo commerce scalability notes
Woo commerce scalability   notesWoo commerce scalability   notes
Woo commerce scalability notes
Edmund Turbin
 
Just For You - How to drive better engagement with localisation-based insights.
Just For You - How to drive better engagement with localisation-based insights.Just For You - How to drive better engagement with localisation-based insights.
Just For You - How to drive better engagement with localisation-based insights.
Edmund Turbin
 

More from Edmund Turbin (14)

Remote Control WordPress
Remote Control WordPressRemote Control WordPress
Remote Control WordPress
 
Production Ready WordPress #WPLDN
Production Ready WordPress #WPLDNProduction Ready WordPress #WPLDN
Production Ready WordPress #WPLDN
 
Production Ready WordPress - WC Utrecht 2017
Production Ready WordPress  - WC Utrecht 2017Production Ready WordPress  - WC Utrecht 2017
Production Ready WordPress - WC Utrecht 2017
 
Production ready word press
Production ready word pressProduction ready word press
Production ready word press
 
The Themer's Guide to WP-CLI
The Themer's Guide to WP-CLIThe Themer's Guide to WP-CLI
The Themer's Guide to WP-CLI
 
The Themer's Guide to WP-CLI
The Themer's Guide to WP-CLIThe Themer's Guide to WP-CLI
The Themer's Guide to WP-CLI
 
Customize it.
Customize it.Customize it.
Customize it.
 
Theming in WordPress - Where do I Start?
Theming in WordPress - Where do I Start?Theming in WordPress - Where do I Start?
Theming in WordPress - Where do I Start?
 
Word press gets responsive 4x3
Word press gets responsive 4x3Word press gets responsive 4x3
Word press gets responsive 4x3
 
Scaling WooCommerce on WP Engine
Scaling WooCommerce on WP EngineScaling WooCommerce on WP Engine
Scaling WooCommerce on WP Engine
 
Working in Harmony: Manchester - Optimize development and content workflows
Working in Harmony: Manchester - Optimize development and content workflowsWorking in Harmony: Manchester - Optimize development and content workflows
Working in Harmony: Manchester - Optimize development and content workflows
 
Working in harmony
Working in harmonyWorking in harmony
Working in harmony
 
Woo commerce scalability notes
Woo commerce scalability   notesWoo commerce scalability   notes
Woo commerce scalability notes
 
Just For You - How to drive better engagement with localisation-based insights.
Just For You - How to drive better engagement with localisation-based insights.Just For You - How to drive better engagement with localisation-based insights.
Just For You - How to drive better engagement with localisation-based insights.
 

Recently uploaded

leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 

Recently uploaded (20)

leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 

Configuration Management in WordPress

  • 2. 1. Intro 2. Data and WordPress & Configuration 3. Sync Codebase 4. Sync Uploads 5. Sync Database 6. Configuration Management Agenda
  • 3. •Sales Engineer - WP Engine •Developer, Freelancer •CMS Specialist •Open Source •Speaker Edmund Turbin WordCamp Stockholm - Nov 2016
  • 5. CONFIGURATION MANAGEMENT The task of tracking and controlling changes in the software
  • 6. DATA AND WORDPRESS • Core, plugin and theme files • Data stored in a MySQL db • Options/Transients/Object Caching • Media Library assets and files • Configuration wp-config.php WHAT DATA DOES WORDPRESS USE?
  • 7. DATA AND WORDPRESS “Configuration varies across deploys, code stays the same”
  • 8. DATA AND WORDPRESS • Database • Files • Uploads WHAT DATA IS NEEDED FOR DEPLOYMENT?
  • 9. DATA AND WORDPRESS • wp-config.php - keeps site specific configuration • Different when using multiple dev environments • Has sensitive information CONFIGURATION
  • 10. DATA AND WORDPRESS • Some settings apply to all environments • Each environment has unique settings • Credentials will be different each environment • Keep credentials out of version control CONFIGURATION WITH MULTIPLE ENVIRONMENTS
  • 11. DATA AND WORDPRESS • Allows you to keep variations of your wp-config.php • Each environment has it’s own unique config • Uses variables to include proper configuration file DOTENV https://m.dotdev.co/secure-your-wordpress-config-with-dotenv-d939fcb06e24
  • 13. DEPLOYMENT • SFTP/FTP • Version Control - GIT, SVN SYNC CODEBASE
  • 14. DEPLOYMENT • Version Control allows you to be sure that all changes are pushed to environments •Can ignore files and directories that are not needed SYNC CODEBASE
  • 16. DEPLOYMENT • Typically not stored in version control • Files can be large • Will not change very much UPLOADS DIRECTORY
  • 17. DEPLOYMENT • Copy all files • Copy files you need • Point to files on another server SYNC UPLOADS METHODS
  • 18. DEPLOYMENT • FTP can be used to copy the entire uploads directory • Can be done with client app COPY ALL FILES
  • 19. DEPLOYMENT • rsync -avz --rsh=ssh user@host:/path/to/wp-content/uploads/* . • Requires SSH some command line chops • Not available on all hosting providers COPY ALL FILES - RSYNC
  • 20. DEPLOYMENT • FTP can be used to copy only recent files • WordPress organizes uploads by date if configured COPY SOME FILES
  • 22. PLUGIN: UPLOADS BY PROXY https://wordpress.org/plugins/uploads-by-proxy/
  • 23. PLUGIN: UPLOADS BY PROXY WP-CONFIG.PHP SETTINGS https://wordpress.org/plugins/uploads-by-proxy/ //** Uploads by Proxy */ define('WP_SITEURL', 'http://edmund.local'); define('UBP_IS_LOCAL', true); define('UBP_SITEURL', 'http://www.edmundturbin.com');
  • 25. DATA IN WORDPRESS • WP-CLI • SFTP/FTP & mysql import • 3rd party plugins MOVE DATABASE EXPORT ACROSS ENVIRONMENTS
  • 26. DATABASE MIGRATION • WP-CLI • MySQL import • PHPMyAdmin DATABASE IMPORT
  • 27. DATABASE MIGRATION • Allow you to run remote wp-cli commands • Connects via SSH behind the scenes • @dev, @stage, @production • Uses a prefix before wp-cli command • wp @dev cli info WP-CLI ALIASES
  • 28. DATABASE MIGRATION • wp @production db export > production_db_export.sql • wp @dev db reset —yes •wp @dev db import production_db_export.sql • wp @dev search-replace example.com example.dev SYNC DATABASE ACROSS ENVIRONMENTS https://gist.github.com/retlehs/aa47003249623e52b95a3fcd6f69b8fb#file-sync-prod-sh
  • 30. CONFIGURATION MANAGEMENT • Save time by transferring only what we need • Less data to be transferred • Data does not need to be synced WHAT IF WE ONLY NEED TO MAKE A FEW CHANGES?
  • 31. CONFIGURATION MANAGEMENT • Settings are unique - site_url, home_url • Not all plugins are needed on production • Site admins or user can make settings changes WHAT IF SETTINGS ARE DIFFERENT IN EACH ENVIRONMENT?
  • 33. PLUGIN: WP-CFM • Copy settings that you need, not entire DB • Keep track of all settings in a single place • Version Control • Manage multiple environments https://wordpress.org/plugins/wp-cfm/ BENEFITS
  • 34. PLUGIN: WP-CFM • Allows you to save options • Can be saved as sets called Bundles • Push changes to file • Pull changes into database https://wordpress.org/plugins/wp-cfm/ HOW DOES IT WORK?
  • 35. PLUGIN: WP-CFM • Data saved to disk as JSON array • Can be committed to a repo • Changes managed in WP Dashboard • Permissions on settings? https://wordpress.org/plugins/wp-cfm/ WORDPRESS CONFIGURATION MANAGEMENT
  • 36. PLUGIN: WP-CFM • WP settings (wp_options table) • Multisite settings (wp_sitemeta table) • Taxonomy terms • Custom Field Suite field groups https://wordpress.org/plugins/wp-cfm/ WHAT DATA CAN BE MANAGED?
  • 37. PLUGIN: WP-CFM wp config pull [bundle_name] wp config push [bundle_name] wp config diff [bundle_name] wp config bundles wp config show_bundle [bundle_name] https://wordpress.org/plugins/wp-cfm/ WP-CLI COMMANDS
  • 38. Codebase & Uploads Version control ensures your codebase is synced. Uploads pulled down regularly
  • 39. WP-CLI for DB Sync WP-CLI can make it simple to keep your content in sync across multiple environments
  • 40. Configuration Can differ across different tiers, but can still be managed centrally within codebase.