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

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 

Recently uploaded (20)

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 

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