SlideShare a Scribd company logo
1 of 48
Download to read offline
KEEPING LOCAL, STAGING &
PRODUCTION SITES IN SYNC
Or, Stop Being A Cowboy Coder!
HI! I’M DAVID
Malaysia
blogjunkie
ClickWP
≃10 yearsƁ
STOP BEING A
COWBOY CODER
FRAMING THE
DISCUSSION
Work on a staging copy 

of the site instead
Editing code on live sites 

is dangerous
production site
pro·duc·tion | prə-ˈdək-shən
The live version of your site,
available to public audiences
staging site
sta·ging | stey-jing
A test copy of the site, for
testing and QA of new code,
design or features
Make changes to a local copy,
then sync to staging / production
It's inefficient to make direct
changes to sites on the web
local development site
de·vel·op·ment | di-ˈve-ləp-mənt
A copy of the site for creating or
producing new features and/or
designs in a safe and portable
environment
Use DesktopServer or MAMP
It's difficult to run local copies of sites
I’ve got some recommendations
to make it easier
Syncing updates is difficult
Move changes upstream
push
staging production
new changes
Copy changes downstream
pull
staging production
new changes
STOP BEING A COWBOY
HOW TO CREATE
STAGING SITES
WEB HOSTS WITH 1-CLICK STAGING
• WP Engine
• SiteGround
• Flywheel

• Pressable
• Media Temple
• GoDaddy
MANUAL STAGING COPY
• Copy, export, import and scrub
database
• Use a backup + migration plugin e.g.
Duplicator (free) or BackupBuddy
(premium)
HOW TO CREATE
LOCAL DEV SITES
• DesktopServer
• MAMP / XAMPP / WAMP
• Virtual machines e.g. Vagrant
SYNCING CHANGES
Create staging copy
5GB / 30 mins
Sync changes to production
5GB / 30 mins
a-wp-site.com
UPLOADS
DBFILES
WHAT CHANGED?
ACTION CHANGED
Edited theme files Files (theme)
Changed theme or plugin settings Database
Switched themes Files (theme) + Database
Publish new post Database + Uploads
SYNC CHANGES ONLY
Even for staging sites; no need to create
new staging site each time
Uploads don’t need to be synced as much
Take care not to overwrite user generated
content e.g. comments
HOW TO SYNC
GUIDELINES TO LIVE BY
Always. Backup. Production.
Database replacements should only go
production → staging / dev
Deploy from dev to production if possible
(avoid staging)
EASY WAYS TO SYNC
FTP client
WP MIGRATE DB PRO
• Push and pull databases
• Media add-on will even sync files
• Starts at $90/yr - deliciousbrains.com
• Alternate, free fork = WP Sync DB

github.com/wp-­‐sync-­‐db/wp-­‐sync-­‐db
WP Sync DB / WP Migrate DB Pro
DUPLICATOR PLUGIN
• Cannot sync changes only
• Geared at technical audience
• Great free alternative
• https://wordpress.org/plugins/
duplicator/
BACKUPBUDDY DEPLOYMENT
• Sync changes from / to development,
staging and production
• Push and pull selected themes, plugins
and database tables
• A little iffy, not 100% reliable
• https://ithemes.com/wordpress-­‐
backup-­‐plugin-­‐for-­‐developers/
ADVANCED 

WAYS TO SYNC
RSYNC + WP MIGRATE DB PRO
rsync	
  -­‐avh	
  ./wp-­‐content/themes/	
  
user@stagingserver.com:/path/to/wp-­‐content/themes/
Transfer files from dev to staging
Then push database to staging with 

WP Migrate DB Pro
WORDMOVE
• Ruby gem that automatically syncs local
and remote site files and DB
• “Think of it like Capistrano for
WordPress, complete with push/pull
capabilities”
• Can’t selectively push/pull DB tables
• https://github.com/welaika/wordmove
PRO TIPS
ZIPPED FILES UPLOAD FASTER
UPLOAD PACKAGE TIME
wordpress-4.2.2.zip
1 file / 6.9MB
30 seconds
WordPress, unzipped
1,311 files / 26.1MB
15 minutes
DON’T SYNC UPLOADS
#	
  ~/wp-­‐content/uploads/.htaccess	
  
RewriteEngine	
  on	
  	
  
RewriteCond	
  %{REQUEST_FILENAME}	
  !-­‐d	
  	
  
RewriteCond	
  %{REQUEST_FILENAME}	
  !-­‐f	
  	
  
#	
  Production	
  site	
  lives	
  at	
  http://example.com	
  	
  
RewriteRule	
  (.*)	
  http://example.com/wp-­‐content/uploads/$1	
  
Load uploads from production with .htaccess
Alternatively, use the Uploads by Proxy plugin
wordpress.org/plugins/uploads-­‐by-­‐proxy/
DISABLE PLUGINS ON DEV / STAGING
if	
  (	
  defined(	
  'WP_LOCAL_DEV'	
  )	
  &&	
  WP_LOCAL_DEV	
  )	
  {	
  
	
   new	
  CWS_Disable_Plugins_When_Local_Dev(	
  array(	
  	
  
	
   	
   'google-­‐analyticator/google-­‐analyticator.php',	
  
	
   	
   'vaultpress/vaultpress.php',	
  
	
   	
   'w3-­‐total-­‐cache/w3-­‐total-­‐cache.php',	
  
	
   	
   'wordfence/wordfence.php',	
  
	
   	
   'wordpress-­‐https/wordpress-­‐https.php',	
  
	
   )	
  );	
  
}
https://markjaquith.wordpress.com/
2011/06/24/wordpress-­‐local-­‐dev-­‐tips/
WP LOCAL TOOLBOX
• Control your dev, staging and live
environments without touching the DB
• Can disable plugins, but needs to modify 

wp-config.php file
• wordpress.org/plugins/wp-­‐local-­‐toolbox/
MY WORKFLOW
EXAMPLE SITES
Local Dev localhost/genesiscamp
Staging genesiscamp.clickwpstaging.com
Production www.epikwebsite.com
Modern WordPress Workflow

teamtreehouse.com / referrals.trhou.se/blogjunkie
DesktopServer

www.serverpress.com
Wordmove

github.com/welaika/wordmove
BackupBuddy

ithemes.com/backupbuddy/
WP Sync DB

github.com/wp-­‐sync-­‐db/wp-­‐sync-­‐db
THANK YOU SERVERPRESS!
Use coupon code
genesiscamp	
  
to save 20% on DesktopServer
www.serverpress.com
THANK YOU!
@blogjunkie / clickwp.com

More Related Content

What's hot

Varying WordPress Development Environment WordCamp Cincinnati 2016
Varying WordPress Development Environment WordCamp Cincinnati 2016Varying WordPress Development Environment WordCamp Cincinnati 2016
Varying WordPress Development Environment WordCamp Cincinnati 2016David Brattoli
 
WP-CLI: WordCamp Nashville 2016
WP-CLI: WordCamp Nashville 2016WP-CLI: WordCamp Nashville 2016
WP-CLI: WordCamp Nashville 2016Terell Moore
 
Professional WordPress Development with Vagrant - Andrea Cardinali - WordCam...
Professional WordPress Development with Vagrant - Andrea Cardinali -  WordCam...Professional WordPress Development with Vagrant - Andrea Cardinali -  WordCam...
Professional WordPress Development with Vagrant - Andrea Cardinali - WordCam...Andrea Cardinali
 
Bluemix - Deploying a Java Web Application
Bluemix - Deploying a Java Web ApplicationBluemix - Deploying a Java Web Application
Bluemix - Deploying a Java Web ApplicationCraig Trim
 
Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016David Brattoli
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Gavin Pickin
 
Meguro.dev でのLT資料
Meguro.dev でのLT資料Meguro.dev でのLT資料
Meguro.dev でのLT資料yusato14
 
Docker dev, test & production (afas)
Docker  dev, test & production (afas)Docker  dev, test & production (afas)
Docker dev, test & production (afas)Wouter Lagerweij
 
Git and Github - a 90 Minute interactive workshop
Git and Github - a 90 Minute interactive workshopGit and Github - a 90 Minute interactive workshop
Git and Github - a 90 Minute interactive workshopBram Luyten
 
Modern Web Application Development Workflow - web2day 2014
Modern Web Application Development Workflow - web2day 2014Modern Web Application Development Workflow - web2day 2014
Modern Web Application Development Workflow - web2day 2014Stéphane Bégaudeau
 
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
 
Introducing WordPress Multitenancy (Wordcamp Vegas/Orlando 2015/WPCampus)
Introducing WordPress Multitenancy (Wordcamp Vegas/Orlando 2015/WPCampus)Introducing WordPress Multitenancy (Wordcamp Vegas/Orlando 2015/WPCampus)
Introducing WordPress Multitenancy (Wordcamp Vegas/Orlando 2015/WPCampus)Cliff Seal
 
WP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of DeveloperWP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of DeveloperChandra Patel
 
Intro to CakePHP 1.3
Intro to CakePHP 1.3Intro to CakePHP 1.3
Intro to CakePHP 1.3Adam Culp
 
Multi tenant CMSes using php
Multi tenant CMSes using phpMulti tenant CMSes using php
Multi tenant CMSes using phpkae-verens
 
EdTechJoker Spring 2020 - Lecture 5 grav cms
EdTechJoker Spring 2020 - Lecture 5 grav cmsEdTechJoker Spring 2020 - Lecture 5 grav cms
EdTechJoker Spring 2020 - Lecture 5 grav cmsBryan Ollendyke
 
A look at FastCgi & Mod_PHP architecture
A look at FastCgi & Mod_PHP architectureA look at FastCgi & Mod_PHP architecture
A look at FastCgi & Mod_PHP architectureAimee Maree Forsstrom
 
Php Performance On Windows
Php Performance On WindowsPhp Performance On Windows
Php Performance On Windowsruslany
 
PHP Enhancement with Windows Server 2008
PHP Enhancement with Windows Server 2008PHP Enhancement with Windows Server 2008
PHP Enhancement with Windows Server 2008Krit Kamtuo
 

What's hot (20)

Varying WordPress Development Environment WordCamp Cincinnati 2016
Varying WordPress Development Environment WordCamp Cincinnati 2016Varying WordPress Development Environment WordCamp Cincinnati 2016
Varying WordPress Development Environment WordCamp Cincinnati 2016
 
WP-CLI: WordCamp Nashville 2016
WP-CLI: WordCamp Nashville 2016WP-CLI: WordCamp Nashville 2016
WP-CLI: WordCamp Nashville 2016
 
Professional WordPress Development with Vagrant - Andrea Cardinali - WordCam...
Professional WordPress Development with Vagrant - Andrea Cardinali -  WordCam...Professional WordPress Development with Vagrant - Andrea Cardinali -  WordCam...
Professional WordPress Development with Vagrant - Andrea Cardinali - WordCam...
 
Bluemix - Deploying a Java Web Application
Bluemix - Deploying a Java Web ApplicationBluemix - Deploying a Java Web Application
Bluemix - Deploying a Java Web Application
 
Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
 
Meguro.dev でのLT資料
Meguro.dev でのLT資料Meguro.dev でのLT資料
Meguro.dev でのLT資料
 
Docker dev, test & production (afas)
Docker  dev, test & production (afas)Docker  dev, test & production (afas)
Docker dev, test & production (afas)
 
Git and Github - a 90 Minute interactive workshop
Git and Github - a 90 Minute interactive workshopGit and Github - a 90 Minute interactive workshop
Git and Github - a 90 Minute interactive workshop
 
Modern Web Application Development Workflow - web2day 2014
Modern Web Application Development Workflow - web2day 2014Modern Web Application Development Workflow - web2day 2014
Modern Web Application Development Workflow - web2day 2014
 
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...
 
Introducing WordPress Multitenancy (Wordcamp Vegas/Orlando 2015/WPCampus)
Introducing WordPress Multitenancy (Wordcamp Vegas/Orlando 2015/WPCampus)Introducing WordPress Multitenancy (Wordcamp Vegas/Orlando 2015/WPCampus)
Introducing WordPress Multitenancy (Wordcamp Vegas/Orlando 2015/WPCampus)
 
WP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of DeveloperWP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of Developer
 
Locking Down CF Servers
Locking Down CF ServersLocking Down CF Servers
Locking Down CF Servers
 
Intro to CakePHP 1.3
Intro to CakePHP 1.3Intro to CakePHP 1.3
Intro to CakePHP 1.3
 
Multi tenant CMSes using php
Multi tenant CMSes using phpMulti tenant CMSes using php
Multi tenant CMSes using php
 
EdTechJoker Spring 2020 - Lecture 5 grav cms
EdTechJoker Spring 2020 - Lecture 5 grav cmsEdTechJoker Spring 2020 - Lecture 5 grav cms
EdTechJoker Spring 2020 - Lecture 5 grav cms
 
A look at FastCgi & Mod_PHP architecture
A look at FastCgi & Mod_PHP architectureA look at FastCgi & Mod_PHP architecture
A look at FastCgi & Mod_PHP architecture
 
Php Performance On Windows
Php Performance On WindowsPhp Performance On Windows
Php Performance On Windows
 
PHP Enhancement with Windows Server 2008
PHP Enhancement with Windows Server 2008PHP Enhancement with Windows Server 2008
PHP Enhancement with Windows Server 2008
 

Similar to Keeping Local, Staging & Production Sites In Sync

WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments Ohad Raz
 
No more “cowboy coding”
No more “cowboy coding”No more “cowboy coding”
No more “cowboy coding”Jim True
 
Rock Solid WordPress
Rock Solid WordPressRock Solid WordPress
Rock Solid WordPressErik Osterman
 
Dont Break Live lightning talk
Dont Break Live lightning talkDont Break Live lightning talk
Dont Break Live lightning talkJamie Schmid
 
Building a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToBuilding a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToRaymond Camden
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011Bachkoutou Toutou
 
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...Erich Beyrent
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Michael Lihs
 
Site Development Processes for Small Teams
Site Development Processes for Small TeamsSite Development Processes for Small Teams
Site Development Processes for Small TeamsJeff Segars
 
PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...
PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...
PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...Puppet
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance DrupalJeff Geerling
 
No More “Cowboy Coding”: A Best Practices Guide to Local Development & Migration
No More “Cowboy Coding”: A Best Practices Guide to Local Development & MigrationNo More “Cowboy Coding”: A Best Practices Guide to Local Development & Migration
No More “Cowboy Coding”: A Best Practices Guide to Local Development & Migrationpodsframework
 
Serverless preview environments to the rescue
Serverless preview environments to the rescueServerless preview environments to the rescue
Serverless preview environments to the rescueJoseph Lust
 
Easing ASP.NET Web and SQL Server Database Deployment with VS 2010 and MsDeploy
Easing ASP.NET Web and  SQL Server Database Deployment withVS 2010 and MsDeployEasing ASP.NET Web and  SQL Server Database Deployment withVS 2010 and MsDeploy
Easing ASP.NET Web and SQL Server Database Deployment with VS 2010 and MsDeployEduardo Castro
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesdrupalindia
 
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
 
Саша Белецкий "Continuous Delivery в продуктовой разработке"
Саша Белецкий "Continuous Delivery в продуктовой разработке"Саша Белецкий "Continuous Delivery в продуктовой разработке"
Саша Белецкий "Continuous Delivery в продуктовой разработке"Agile Base Camp
 
COB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersCOB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersChris O'Brien
 
Creating Local WordPress Installs
Creating Local WordPress InstallsCreating Local WordPress Installs
Creating Local WordPress Installsmcgaritydotme
 

Similar to Keeping Local, Staging & Production Sites In Sync (20)

WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
 
No more “cowboy coding”
No more “cowboy coding”No more “cowboy coding”
No more “cowboy coding”
 
Rock Solid WordPress
Rock Solid WordPressRock Solid WordPress
Rock Solid WordPress
 
Dont Break Live lightning talk
Dont Break Live lightning talkDont Break Live lightning talk
Dont Break Live lightning talk
 
Building a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToBuilding a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared To
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011
 
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Site Development Processes for Small Teams
Site Development Processes for Small TeamsSite Development Processes for Small Teams
Site Development Processes for Small Teams
 
PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...
PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...
PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
 
No More “Cowboy Coding”: A Best Practices Guide to Local Development & Migration
No More “Cowboy Coding”: A Best Practices Guide to Local Development & MigrationNo More “Cowboy Coding”: A Best Practices Guide to Local Development & Migration
No More “Cowboy Coding”: A Best Practices Guide to Local Development & Migration
 
Serverless preview environments to the rescue
Serverless preview environments to the rescueServerless preview environments to the rescue
Serverless preview environments to the rescue
 
Easing ASP.NET Web and SQL Server Database Deployment with VS 2010 and MsDeploy
Easing ASP.NET Web and  SQL Server Database Deployment withVS 2010 and MsDeployEasing ASP.NET Web and  SQL Server Database Deployment withVS 2010 and MsDeploy
Easing ASP.NET Web and SQL Server Database Deployment with VS 2010 and MsDeploy
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
 
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
 
Deploy like a pro!
Deploy like a pro!Deploy like a pro!
Deploy like a pro!
 
Саша Белецкий "Continuous Delivery в продуктовой разработке"
Саша Белецкий "Continuous Delivery в продуктовой разработке"Саша Белецкий "Continuous Delivery в продуктовой разработке"
Саша Белецкий "Continuous Delivery в продуктовой разработке"
 
COB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersCOB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developers
 
Creating Local WordPress Installs
Creating Local WordPress InstallsCreating Local WordPress Installs
Creating Local WordPress Installs
 

Recently uploaded

Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 

Recently uploaded (20)

Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 

Keeping Local, Staging & Production Sites In Sync

  • 1. KEEPING LOCAL, STAGING & PRODUCTION SITES IN SYNC Or, Stop Being A Cowboy Coder!
  • 5. Work on a staging copy 
 of the site instead Editing code on live sites 
 is dangerous
  • 6. production site pro·duc·tion | prə-ˈdək-shən The live version of your site, available to public audiences
  • 7. staging site sta·ging | stey-jing A test copy of the site, for testing and QA of new code, design or features
  • 8. Make changes to a local copy, then sync to staging / production It's inefficient to make direct changes to sites on the web
  • 9. local development site de·vel·op·ment | di-ˈve-ləp-mənt A copy of the site for creating or producing new features and/or designs in a safe and portable environment
  • 10. Use DesktopServer or MAMP It's difficult to run local copies of sites
  • 11. I’ve got some recommendations to make it easier Syncing updates is difficult
  • 12. Move changes upstream push staging production new changes
  • 13. Copy changes downstream pull staging production new changes
  • 14. STOP BEING A COWBOY
  • 16. WEB HOSTS WITH 1-CLICK STAGING • WP Engine • SiteGround • Flywheel
 • Pressable • Media Temple • GoDaddy
  • 17. MANUAL STAGING COPY • Copy, export, import and scrub database • Use a backup + migration plugin e.g. Duplicator (free) or BackupBuddy (premium)
  • 18. HOW TO CREATE LOCAL DEV SITES
  • 19. • DesktopServer • MAMP / XAMPP / WAMP • Virtual machines e.g. Vagrant
  • 21. Create staging copy 5GB / 30 mins Sync changes to production 5GB / 30 mins
  • 23. WHAT CHANGED? ACTION CHANGED Edited theme files Files (theme) Changed theme or plugin settings Database Switched themes Files (theme) + Database Publish new post Database + Uploads
  • 24. SYNC CHANGES ONLY Even for staging sites; no need to create new staging site each time Uploads don’t need to be synced as much Take care not to overwrite user generated content e.g. comments
  • 26. GUIDELINES TO LIVE BY Always. Backup. Production. Database replacements should only go production → staging / dev Deploy from dev to production if possible (avoid staging)
  • 27. EASY WAYS TO SYNC
  • 29. WP MIGRATE DB PRO • Push and pull databases • Media add-on will even sync files • Starts at $90/yr - deliciousbrains.com • Alternate, free fork = WP Sync DB
 github.com/wp-­‐sync-­‐db/wp-­‐sync-­‐db
  • 30. WP Sync DB / WP Migrate DB Pro
  • 31. DUPLICATOR PLUGIN • Cannot sync changes only • Geared at technical audience • Great free alternative • https://wordpress.org/plugins/ duplicator/
  • 32. BACKUPBUDDY DEPLOYMENT • Sync changes from / to development, staging and production • Push and pull selected themes, plugins and database tables • A little iffy, not 100% reliable • https://ithemes.com/wordpress-­‐ backup-­‐plugin-­‐for-­‐developers/
  • 33.
  • 34.
  • 35.
  • 37. RSYNC + WP MIGRATE DB PRO rsync  -­‐avh  ./wp-­‐content/themes/   user@stagingserver.com:/path/to/wp-­‐content/themes/ Transfer files from dev to staging Then push database to staging with 
 WP Migrate DB Pro
  • 38. WORDMOVE • Ruby gem that automatically syncs local and remote site files and DB • “Think of it like Capistrano for WordPress, complete with push/pull capabilities” • Can’t selectively push/pull DB tables • https://github.com/welaika/wordmove
  • 40. ZIPPED FILES UPLOAD FASTER UPLOAD PACKAGE TIME wordpress-4.2.2.zip 1 file / 6.9MB 30 seconds WordPress, unzipped 1,311 files / 26.1MB 15 minutes
  • 41. DON’T SYNC UPLOADS #  ~/wp-­‐content/uploads/.htaccess   RewriteEngine  on     RewriteCond  %{REQUEST_FILENAME}  !-­‐d     RewriteCond  %{REQUEST_FILENAME}  !-­‐f     #  Production  site  lives  at  http://example.com     RewriteRule  (.*)  http://example.com/wp-­‐content/uploads/$1   Load uploads from production with .htaccess Alternatively, use the Uploads by Proxy plugin wordpress.org/plugins/uploads-­‐by-­‐proxy/
  • 42. DISABLE PLUGINS ON DEV / STAGING if  (  defined(  'WP_LOCAL_DEV'  )  &&  WP_LOCAL_DEV  )  {     new  CWS_Disable_Plugins_When_Local_Dev(  array(         'google-­‐analyticator/google-­‐analyticator.php',       'vaultpress/vaultpress.php',       'w3-­‐total-­‐cache/w3-­‐total-­‐cache.php',       'wordfence/wordfence.php',       'wordpress-­‐https/wordpress-­‐https.php',     )  );   } https://markjaquith.wordpress.com/ 2011/06/24/wordpress-­‐local-­‐dev-­‐tips/
  • 43. WP LOCAL TOOLBOX • Control your dev, staging and live environments without touching the DB • Can disable plugins, but needs to modify 
 wp-config.php file • wordpress.org/plugins/wp-­‐local-­‐toolbox/
  • 45. EXAMPLE SITES Local Dev localhost/genesiscamp Staging genesiscamp.clickwpstaging.com Production www.epikwebsite.com
  • 46. Modern WordPress Workflow
 teamtreehouse.com / referrals.trhou.se/blogjunkie DesktopServer
 www.serverpress.com Wordmove
 github.com/welaika/wordmove BackupBuddy
 ithemes.com/backupbuddy/ WP Sync DB
 github.com/wp-­‐sync-­‐db/wp-­‐sync-­‐db
  • 47. THANK YOU SERVERPRESS! Use coupon code genesiscamp   to save 20% on DesktopServer www.serverpress.com