SlideShare uma empresa Scribd logo
1 de 38
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabric
andymccurdy
 
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
Ortus Solutions, Corp
 

Mais procurados (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
 

Destaque

Wordpress version control
Wordpress version controlWordpress version control
Wordpress version control
David Doolin
 
WP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealWP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp Montreal
Shawn Hooper
 

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

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

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.
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011
Bachkoutou Toutou
 
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
dotCloud
 
Hadoop 20111117
Hadoop 20111117Hadoop 20111117
Hadoop 20111117
exsuns
 

Semelhante 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

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
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
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
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

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