SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
Hi, I’m Japh
WordPress guy at
Migrating a Site Quickly with
SSH and WP-CLI
(It's not as scary as you think!)
Let’s talk about scary things!
•

Migrations

•

Command-Line

•

SSH
Let’s make them not scary
anymore!
What is SSH?

•

Connecting to the command-line on a remote computer

•

Secure
How do I “SSH”?
•

Terminal (Mac OS X) - If you don’t have it, you’re not on a Mac…

•

PuTTY (Windows) - http://enva.to/puttywin

•

Prompt (iOS) - http://enva.to/promptios
•

Why even use the command-line?

•

WP-CLI helps too!
Command-Line 101 (Cheatsheet)
•

<command> --help - many programs have a built-in “help” to show you basic usage information

•

man <command> - “manual” program to show information on how to use a command

•

cd - change directory

•

~ - special shortcut to indicate my home directory

•

ls - list contents of the current directory

•

pwd - show the current (working) directory’s path

•

cp - copy

•

scp - secure copy

•

cat - output file contents

•

gzip - a compression program

•

gunzip - a decompression program

•

find - search for files

•

mysql - connect to a MySQL server

•

mysqldump - “dump” from a MySQL server

•

| - “pipe” output to another program

•

> - output to a file

•

< - input from a file

•

grep - regular expressions

•

rm - remove / delete (be careful on this one)

•

Tab completion!
Let’s do this…
SSH
Connecting from your computer, to the server you’re migrating from
Install WP-CLI
http://wp-cli.org/
This will differ from host to host, but there are good instructions on the site
wp db export - | gzip > ~/migration/moredemo.sql.gz
•

Firstly, gesundheit!

•

wp - WP-CLI FTW!

•

db - subset of WP-CLI commands to do database things

•

export - this is the particular database thing we want to do

•

- - don’t put the export data in a file, just output it

•

| - pass the output to another program…

•

gzip - compress the passed output

•

> - send the output (now compressed) to a file

•

~/migration/moredemo.sql.gz - the file, named appropriately so that we know what it is! (SQL, gzipped)
tar czvf ~/migration/moredemo.tar.gz ./wp-content/
•

tar - an archiver program for creating and extracting files from archives

•

c - create an archive

•

z - do compression

•

v - show output (so we know something is happening!)

•

f - create this archive as a file

•

~/migration/moredemo.tar.gz - the file to create as an archive

•

./wp-content/ - the files to put into the archive
scp ~/migration/* japheth@lessdevelopment.com:~/webapps/lessdemo/
•

scp - secure copy (can copy to a remote server through SSH)

•

~/migration/* - the files to copy, the * indicates all files in the directory

•

japheth@lessdevelopment.com: - my username and the remote
server’s address
•

•

The format for this is <username>@<domain name or IP address>:

~/webapps/lessdemo/ - the directory on the remote server to copy to,
must come after the :
scp wp-config.php japheth@lessdevelopment.com:~/webapps/lessdemo/
•

scp - secure copy (can copy to a remote server through SSH)

•

wp-config.php - the WordPress config file to copy

•

japheth@lessdevelopment.com: - my username and the remote
server’s address
•

•

The format for this is <username>@<domain name or IP address>:

~/webapps/lessdemo/ - the directory on the remote server to copy to,
must come after the :
scp .htaccess japheth@lessdevelopment.com:~/webapps/lessdemo/
•

scp - secure copy (can copy to a remote server through SSH)

•

.htaccess - the WordPress .htaccess file to copy, important for
permalinks and WordPress Multisite installations

•

japheth@lessdevelopment.com: - my username and the remote
server’s address
•

•

The format for this is <username>@<domain name or IP address>:

~/webapps/lessdemo/ - the directory on the remote server to copy to,
must come after the :
SSH
Connecting from the server you’re migrating from, to the server you’re migrating to
Install WP-CLI
http://wp-cli.org/
This will differ from host to host, but there are good instructions on the site
ls -l

•

ls - program for listing file information

•

-l - show the information in a long list (goes vertically instead of
horizontally, I find it easier to read)
wp core download

•

wp - WP-CLI FTW!

•

core - subset of WP-CLI commands to do core things

•

download - download the latest version of WordPress
tar xzvf moredemo.tar.gz
•

tar - an archiver program for creating and extracting files from archives

•

x - extract an archive

•

z - do compression

•

v - show output (so we know something is happening!)

•

f - create this archive as a file

•

moredemo.tar.gz - the archive file to extract from

•

Automatically re-creates the directory structure that is in the archive
Update your config!
Database name, username, password, and (if your web provider requires) host
gunzip < moredemo.sql.gz | wp db import •

gunzip - uncompress the passed output

•

< - pass the contents of file to be uncompressed

•

moredemo.sql.gz - the file

•

| - pass the output to another program…

•

wp - WP-CLI FTW!

•

db - subset of WP-CLI commands to do database things

•

import - this is the particular database thing we want to do

•

- - don’t get the import data from a file, just use the output being passed
wp search-replace moredevelopment.com lessdevelopment.com

•

wp - WP-CLI FTW!

•

search-replace - a WP-CLI command to do a find and replace on
the database (properly handles serialisation!)

•

moredevelopment.com - this is the string we want to replace

•

lessdevelopment.com - this is the string we want to replace it with
Dance Party!
Other Resources
•

WP Migrate DB (Pro)
•

Coupon code 20% off: WPMELBOURNE20

•

Free Developer license for one lucky person!

•

Find / Replace - InterconnectIT’s “Search Replace DB” ( http://
envat.to/srdb2 )

•

7 Simple and Useful Command-Line Tips ( http://enva.to/cli-tips ) from 2010 and still (mostly) useful!
Thank you!
Questions?
I’m @Japh on Twitter
!

Slides - http://enva.to/migratewp

Más contenido relacionado

La actualidad más candente

StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce StackIQ
 
StackiFest16: Building a Cart
StackiFest16: Building a CartStackiFest16: Building a Cart
StackiFest16: Building a CartStackIQ
 
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...LumoSpark
 
Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Žilvinas Kuusas
 
Automated Tasks for WordPress
Automated Tasks for WordPressAutomated Tasks for WordPress
Automated Tasks for WordPressJoe Cartonia
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabricandymccurdy
 
Cf camp 2019 cfconfig - a new way to manage your cold-fusion engine config
Cf camp 2019   cfconfig - a new way to manage your cold-fusion engine configCf camp 2019   cfconfig - a new way to manage your cold-fusion engine config
Cf camp 2019 cfconfig - a new way to manage your cold-fusion engine configOrtus Solutions, Corp
 
StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackIQ
 
Ansible 101, Gennadiy Mykhailiuta
Ansible 101, Gennadiy MykhailiutaAnsible 101, Gennadiy Mykhailiuta
Ansible 101, Gennadiy MykhailiutaTetiana Saputo
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansibleKhizer Naeem
 
StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz StackIQ
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with AnsibleRayed Alrashed
 
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Local Dev on Virtual Machines - Vagrant, VirtualBox and AnsibleLocal Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Local Dev on Virtual Machines - Vagrant, VirtualBox and AnsibleJeff Geerling
 
StackiFest16: Building a Cluster with Stacki - Greg Bruno
StackiFest16: Building a Cluster with Stacki - Greg BrunoStackiFest16: Building a Cluster with Stacki - Greg Bruno
StackiFest16: Building a Cluster with Stacki - Greg BrunoStackIQ
 
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu ServerForget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Serveraaroncouch
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of AnsibleDevOps Ltd.
 

La actualidad más candente (20)

StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
 
StackiFest16: Building a Cart
StackiFest16: Building a CartStackiFest16: Building a Cart
StackiFest16: Building a Cart
 
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
 
Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)
 
Automated Tasks for WordPress
Automated Tasks for WordPressAutomated Tasks for WordPress
Automated Tasks for WordPress
 
Ansible
AnsibleAnsible
Ansible
 
Cialug August 2021
Cialug August 2021Cialug August 2021
Cialug August 2021
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabric
 
Cf camp 2019 cfconfig - a new way to manage your cold-fusion engine config
Cf camp 2019   cfconfig - a new way to manage your cold-fusion engine configCf camp 2019   cfconfig - a new way to manage your cold-fusion engine config
Cf camp 2019 cfconfig - a new way to manage your cold-fusion engine config
 
StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra
 
Ansible 101, Gennadiy Mykhailiuta
Ansible 101, Gennadiy MykhailiutaAnsible 101, Gennadiy Mykhailiuta
Ansible 101, Gennadiy Mykhailiuta
 
Write php deploy everywhere
Write php deploy everywhereWrite php deploy everywhere
Write php deploy everywhere
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
 
StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Local Dev on Virtual Machines - Vagrant, VirtualBox and AnsibleLocal Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
 
Curl Tutorial
Curl Tutorial Curl Tutorial
Curl Tutorial
 
StackiFest16: Building a Cluster with Stacki - Greg Bruno
StackiFest16: Building a Cluster with Stacki - Greg BrunoStackiFest16: Building a Cluster with Stacki - Greg Bruno
StackiFest16: Building a Cluster with Stacki - Greg Bruno
 
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu ServerForget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
 

Destacado

Wordpress version control
Wordpress version controlWordpress version control
Wordpress version controlDavid Doolin
 
WP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealWP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealShawn Hooper
 
The Neova Health Open Source Tool Chain
The Neova Health  Open Source Tool ChainThe Neova Health  Open Source Tool Chain
The Neova Health Open Source Tool ChainRob Dyke
 
WordPress and Git
WordPress and GitWordPress and Git
WordPress and GitRob Miller
 
Developing with WordPress and Git
Developing with WordPress and GitDeveloping with WordPress and Git
Developing with WordPress and GitRob Miller
 
Introduction to git & WordPress
Introduction to git & WordPressIntroduction to git & WordPress
Introduction to git & WordPressJosh Lee
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development EnvironmentsOscar Merida
 
Introducing Git to your FTP workflow
Introducing Git to your FTP workflow Introducing Git to your FTP workflow
Introducing Git to your FTP workflow Roman Rus
 
Writing Well-Behaved Unix Utilities
Writing Well-Behaved Unix UtilitiesWriting Well-Behaved Unix Utilities
Writing Well-Behaved Unix UtilitiesRob Miller
 
Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.WordCamp Harare
 
WordPress & Version Control: A Workflow
WordPress & Version Control: A WorkflowWordPress & Version Control: A Workflow
WordPress & Version Control: A WorkflowAaron Holbrook
 

Destacado (11)

Wordpress version control
Wordpress version controlWordpress version control
Wordpress version control
 
WP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealWP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp Montreal
 
The Neova Health Open Source Tool Chain
The Neova Health  Open Source Tool ChainThe Neova Health  Open Source Tool Chain
The Neova Health Open Source Tool Chain
 
WordPress and Git
WordPress and GitWordPress and Git
WordPress and Git
 
Developing with WordPress and Git
Developing with WordPress and GitDeveloping with WordPress and Git
Developing with WordPress and Git
 
Introduction to git & WordPress
Introduction to git & WordPressIntroduction to git & WordPress
Introduction to git & WordPress
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development Environments
 
Introducing Git to your FTP workflow
Introducing Git to your FTP workflow Introducing Git to your FTP workflow
Introducing Git to your FTP workflow
 
Writing Well-Behaved Unix Utilities
Writing Well-Behaved Unix UtilitiesWriting Well-Behaved Unix Utilities
Writing Well-Behaved Unix Utilities
 
Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.
 
WordPress & Version Control: A Workflow
WordPress & Version Control: A WorkflowWordPress & Version Control: A Workflow
WordPress & Version Control: A Workflow
 

Similar a Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)

20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnwgarrett honeycutt
 
Administer WordPress with WP-CLI
Administer WordPress with WP-CLIAdminister WordPress with WP-CLI
Administer WordPress with WP-CLISuwash Kunwar
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-wayRobert Lujo
 
Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?Docker, Inc.
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments Ohad Raz
 
Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)Jun Hong Kim
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011Bachkoutou Toutou
 
PHP language presentation
PHP language presentationPHP language presentation
PHP language presentationAnnujj Agrawaal
 
Midwest php 2013 deploying php on paas- why & how
Midwest php 2013   deploying php on paas- why & howMidwest php 2013   deploying php on paas- why & how
Midwest php 2013 deploying php on paas- why & howdotCloud
 
Hadoop 20111117
Hadoop 20111117Hadoop 20111117
Hadoop 20111117exsuns
 
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014ryanduff
 
Jak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneru
Jak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneruJak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneru
Jak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneruVašek Boch
 
WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015Shawn Hooper
 
Web 3, Week 1: Amazon Web Services for Beginners
Web 3, Week 1: Amazon Web Services for BeginnersWeb 3, Week 1: Amazon Web Services for Beginners
Web 3, Week 1: Amazon Web Services for Beginnersjkosoy
 
10x Command Line Fu
10x Command Line Fu10x Command Line Fu
10x Command Line FuAnthony Bui
 
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)Chris Tankersley
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerGeorge Miranda
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
 

Similar a Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!) (20)

20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw
 
Administer WordPress with WP-CLI
Administer WordPress with WP-CLIAdminister WordPress with WP-CLI
Administer WordPress with WP-CLI
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
 
Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)Hadoop meet Rex(How to construct hadoop cluster with rex)
Hadoop meet Rex(How to construct hadoop cluster with rex)
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011
 
PHP language presentation
PHP language presentationPHP language presentation
PHP language presentation
 
Midwest php 2013 deploying php on paas- why & how
Midwest php 2013   deploying php on paas- why & howMidwest php 2013   deploying php on paas- why & how
Midwest php 2013 deploying php on paas- why & how
 
Hadoop 20111117
Hadoop 20111117Hadoop 20111117
Hadoop 20111117
 
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
Extending your WordPress Toolbelt with WP-CLI - WordCamp Austin 2014
 
Jak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneru
Jak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneruJak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneru
Jak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneru
 
WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015
 
Web 3, Week 1: Amazon Web Services for Beginners
Web 3, Week 1: Amazon Web Services for BeginnersWeb 3, Week 1: Amazon Web Services for Beginners
Web 3, Week 1: Amazon Web Services for Beginners
 
10x Command Line Fu
10x Command Line Fu10x Command Line Fu
10x Command Line Fu
 
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
 
Automating with Ansible
Automating with AnsibleAutomating with Ansible
Automating with Ansible
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and Packer
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 

Último

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 

Último (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)

  • 2. Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
  • 3. Let’s talk about scary things!
  • 4.
  • 6. Let’s make them not scary anymore!
  • 7.
  • 8. What is SSH? • Connecting to the command-line on a remote computer • Secure
  • 9. How do I “SSH”? • Terminal (Mac OS X) - If you don’t have it, you’re not on a Mac… • PuTTY (Windows) - http://enva.to/puttywin • Prompt (iOS) - http://enva.to/promptios
  • 10. • Why even use the command-line? • WP-CLI helps too!
  • 11.
  • 12. Command-Line 101 (Cheatsheet) • <command> --help - many programs have a built-in “help” to show you basic usage information • man <command> - “manual” program to show information on how to use a command • cd - change directory • ~ - special shortcut to indicate my home directory • ls - list contents of the current directory • pwd - show the current (working) directory’s path • cp - copy • scp - secure copy • cat - output file contents • gzip - a compression program • gunzip - a decompression program • find - search for files • mysql - connect to a MySQL server • mysqldump - “dump” from a MySQL server • | - “pipe” output to another program • > - output to a file • < - input from a file • grep - regular expressions • rm - remove / delete (be careful on this one) • Tab completion!
  • 14. SSH Connecting from your computer, to the server you’re migrating from
  • 15.
  • 16. Install WP-CLI http://wp-cli.org/ This will differ from host to host, but there are good instructions on the site
  • 17.
  • 18. wp db export - | gzip > ~/migration/moredemo.sql.gz • Firstly, gesundheit! • wp - WP-CLI FTW! • db - subset of WP-CLI commands to do database things • export - this is the particular database thing we want to do • - - don’t put the export data in a file, just output it • | - pass the output to another program… • gzip - compress the passed output • > - send the output (now compressed) to a file • ~/migration/moredemo.sql.gz - the file, named appropriately so that we know what it is! (SQL, gzipped)
  • 19. tar czvf ~/migration/moredemo.tar.gz ./wp-content/ • tar - an archiver program for creating and extracting files from archives • c - create an archive • z - do compression • v - show output (so we know something is happening!) • f - create this archive as a file • ~/migration/moredemo.tar.gz - the file to create as an archive • ./wp-content/ - the files to put into the archive
  • 20. scp ~/migration/* japheth@lessdevelopment.com:~/webapps/lessdemo/ • scp - secure copy (can copy to a remote server through SSH) • ~/migration/* - the files to copy, the * indicates all files in the directory • japheth@lessdevelopment.com: - my username and the remote server’s address • • The format for this is <username>@<domain name or IP address>: ~/webapps/lessdemo/ - the directory on the remote server to copy to, must come after the :
  • 21. scp wp-config.php japheth@lessdevelopment.com:~/webapps/lessdemo/ • scp - secure copy (can copy to a remote server through SSH) • wp-config.php - the WordPress config file to copy • japheth@lessdevelopment.com: - my username and the remote server’s address • • The format for this is <username>@<domain name or IP address>: ~/webapps/lessdemo/ - the directory on the remote server to copy to, must come after the :
  • 22. scp .htaccess japheth@lessdevelopment.com:~/webapps/lessdemo/ • scp - secure copy (can copy to a remote server through SSH) • .htaccess - the WordPress .htaccess file to copy, important for permalinks and WordPress Multisite installations • japheth@lessdevelopment.com: - my username and the remote server’s address • • The format for this is <username>@<domain name or IP address>: ~/webapps/lessdemo/ - the directory on the remote server to copy to, must come after the :
  • 23. SSH Connecting from the server you’re migrating from, to the server you’re migrating to
  • 24.
  • 25. Install WP-CLI http://wp-cli.org/ This will differ from host to host, but there are good instructions on the site
  • 26.
  • 27. ls -l • ls - program for listing file information • -l - show the information in a long list (goes vertically instead of horizontally, I find it easier to read)
  • 28. wp core download • wp - WP-CLI FTW! • core - subset of WP-CLI commands to do core things • download - download the latest version of WordPress
  • 29. tar xzvf moredemo.tar.gz • tar - an archiver program for creating and extracting files from archives • x - extract an archive • z - do compression • v - show output (so we know something is happening!) • f - create this archive as a file • moredemo.tar.gz - the archive file to extract from • Automatically re-creates the directory structure that is in the archive
  • 30. Update your config! Database name, username, password, and (if your web provider requires) host
  • 31.
  • 32. gunzip < moredemo.sql.gz | wp db import • gunzip - uncompress the passed output • < - pass the contents of file to be uncompressed • moredemo.sql.gz - the file • | - pass the output to another program… • wp - WP-CLI FTW! • db - subset of WP-CLI commands to do database things • import - this is the particular database thing we want to do • - - don’t get the import data from a file, just use the output being passed
  • 33. wp search-replace moredevelopment.com lessdevelopment.com • wp - WP-CLI FTW! • search-replace - a WP-CLI command to do a find and replace on the database (properly handles serialisation!) • moredevelopment.com - this is the string we want to replace • lessdevelopment.com - this is the string we want to replace it with
  • 34.
  • 36.
  • 37. Other Resources • WP Migrate DB (Pro) • Coupon code 20% off: WPMELBOURNE20 • Free Developer license for one lucky person! • Find / Replace - InterconnectIT’s “Search Replace DB” ( http:// envat.to/srdb2 ) • 7 Simple and Useful Command-Line Tips ( http://enva.to/cli-tips ) from 2010 and still (mostly) useful!
  • 38. Thank you! Questions? I’m @Japh on Twitter ! Slides - http://enva.to/migratewp