SlideShare une entreprise Scribd logo
1  sur  41
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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 PracticesDylan 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 WorkflowsPhill 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 2011Lenz Grimmer
 
Magento caching
Magento cachingMagento caching
Magento cachingYireo
 
HCL Sametime V11 installation - tips
HCL Sametime V11 installation - tipsHCL Sametime V11 installation - tips
HCL Sametime V11 installation - tipsAles 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 processAshokkumar T A
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with NginxBud Siddhisena
 
Debugging the Web with Fiddler
Debugging the Web with FiddlerDebugging the Web with Fiddler
Debugging the Web with FiddlerIdo 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 ConnectionsLetsConnect
 
Speeding Up The Snail
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The SnailMarcus 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-PremisesGabriella Davis
 
Caching strategies with lucee
Caching strategies with luceeCaching strategies with lucee
Caching strategies with luceeGert Franz
 
Setting up a local WordPress Environment
Setting up a local WordPress EnvironmentSetting up a local WordPress Environment
Setting up a local WordPress EnvironmentChris 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 365Dylan 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 templateGert Franz
 

Tendances (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
 

Similaire à Configuration Management in WordPress

wp-config Tips and Tricks
wp-config Tips and Trickswp-config Tips and Tricks
wp-config Tips and TricksJosh Harrison
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011Bachkoutou 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 NetworkWilliam 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 deploymentSharon 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 OrionSolarWinds
 
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 MistakesCT Moore
 
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 SafelyAngela 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 TrivandrumWordPress Trivandrum
 
Deployment and Management of Hadoop Clusters
Deployment and Management of Hadoop ClustersDeployment and Management of Hadoop Clusters
Deployment and Management of Hadoop ClustersAmal G Jose
 
NGINX: Basics and Best Practices
NGINX: Basics and Best PracticesNGINX: Basics and Best Practices
NGINX: Basics and Best PracticesNGINX, Inc.
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuis 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 V12Howard 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 WindowsAlessandro 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 Connectionspanagenda
 
Week6 office-hours
Week6 office-hoursWeek6 office-hours
Week6 office-hoursRandall Rode
 
No more “cowboy coding”
No more “cowboy coding”No more “cowboy coding”
No more “cowboy coding”Jim True
 

Similaire à 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”
 

Plus de Edmund Turbin

Remote Control WordPress
Remote Control WordPressRemote Control WordPress
Remote Control WordPressEdmund Turbin
 
Production Ready WordPress #WPLDN
Production Ready WordPress #WPLDNProduction Ready WordPress #WPLDN
Production Ready WordPress #WPLDNEdmund Turbin
 
Production Ready WordPress - WC Utrecht 2017
Production Ready WordPress  - WC Utrecht 2017Production Ready WordPress  - WC Utrecht 2017
Production Ready WordPress - WC Utrecht 2017Edmund Turbin
 
Production ready word press
Production ready word pressProduction ready word press
Production ready word pressEdmund 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-CLIEdmund 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-CLIEdmund 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 4x3Edmund Turbin
 
Scaling WooCommerce on WP Engine
Scaling WooCommerce on WP EngineScaling WooCommerce on WP Engine
Scaling WooCommerce on WP EngineEdmund 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 workflowsEdmund Turbin
 
Woo commerce scalability notes
Woo commerce scalability   notesWoo commerce scalability   notes
Woo commerce scalability notesEdmund 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
 

Plus de 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.
 

Dernier

React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 

Dernier (20)

React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 

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.