on the move - migrations made simple

68
On The Move Migrations Made Simple Jonathan Perlman - @jpurpleman WordCamp Montreal 2016 http://jpurpleman.ca/

Upload: jonathan-perlman

Post on 15-Jan-2017

542 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: On the Move - Migrations Made Simple

On The MoveMigrations Made Simple

Jonathan Perlman - @jpurpleman

WordCamp Montreal 2016

http://jpurpleman.ca/

Page 2: On the Move - Migrations Made Simple

What’s covered…

July 18, 2016WordCamp Montreal

• Wordpress.com to self-hosted

• DNS

• The development stack

• Transferring files and data

• Transferring via duplicator

• Transferring data many times

• Check your site

• Resources

Page 3: On the Move - Migrations Made Simple

About me

Developer14 years

Teacher9 years

Trekie Since

ST:TNG

July 18, 2016WordCamp Montreal

Page 4: On the Move - Migrations Made Simple

July 18, 2016WordCamp Montreal

ENGAGE!

Page 5: On the Move - Migrations Made Simple

WordPress.comto

WordPress.org

July 18, 2016WordCamp Montreal

Page 6: On the Move - Migrations Made Simple

What’s the difference?

July 18, 2016WordCamp Montreal

WordPress.org / Self Hosted WordPress.com

Cost Variable, $5 - $20,000 Free

Themes Your choice, no restrictions Limited customizations

Plugins Your choice, no restrictions Limited, no uploading

Control Full control Limited control

Maintenance You manage / You pay for it Automattic does it for you

Backups You manage / You pay for it Automattic does it for you

SSLSecurity

You manage / You pay for it Automattic gives it for you

Page 7: On the Move - Migrations Made Simple

Method

Export

Import

July 18, 2016WordCamp Montreal

Page 8: On the Move - Migrations Made Simple

Export

July 18, 2016WordCamp Montreal

Page 9: On the Move - Migrations Made Simple

Export

July 18, 2016WordCamp Montreal

Page 10: On the Move - Migrations Made Simple

Import

July 18, 2016WordCamp Montreal

Page 11: On the Move - Migrations Made Simple

Import

July 18, 2016WordCamp Montreal

Page 12: On the Move - Migrations Made Simple

DNSDomain Name System

July 18, 2016WordCamp Montreal

Page 13: On the Move - Migrations Made Simple

Overview

July 18, 2016WordCamp Montreal

Page 14: On the Move - Migrations Made Simple

Change your DNS• Modify as Administrator

• Windows

o c:\windows\system32\drivers\etc\hosts

• Apple

o /etc/hosts

• http://www.howtogeek.com/howto/27350/

beginner-geek-how-to-edit-your-hosts-file/

• https://www.tekrevue.com/tip/edit-hosts-file-mac-os-x/

• https://www.whatsmydns.net/

July 18, 2016WordCamp Montreal

Page 15: On the Move - Migrations Made Simple

Windows

July 18, 2016WordCamp Montreal

• Using the Windows Logo use the Start Menu /

Screen and search for Notepad

• Right click Notepad and “Run as Administrator”

c:\windows\system32\drivers\etc\hosts

Page 16: On the Move - Migrations Made Simple

Adding the entry

July 18, 2016WordCamp Montreal

Page 17: On the Move - Migrations Made Simple

Apple• Use the app called GasMask from Clockwise

• Download

o http://clockwise.ee/

• Tutorial

o http://www.gilsmethod.com/how-to-edit-hosts-

files-in-mac-os-x-without-the-headaches

July 18, 2016WordCamp Montreal

Page 18: On the Move - Migrations Made Simple

Transferring Files and Data

July 18, 2016WordCamp Montreal

Page 19: On the Move - Migrations Made Simple

What are we moving?

PHP / HTML / CSS

WordPress Core

Plugins

Themes

JPG, PNG, GIF, DOC, PDF

Media

POSTS

PAGES

SQL Database

July 18, 2016WordCamp Montreal

Page 20: On the Move - Migrations Made Simple

How to migrate it?

With WordPress Plugins Without WordPress

July 18, 2016WordCamp Montreal

• Duplicator

• Backup Buddy

• WP Migrate DB Pro

• File Transfer Program

o FileZilla

o CyberDuck

o Transmit

• Database client

o phpMyAdmin

o HiediSQL

Page 21: On the Move - Migrations Made Simple

File Transfer• Don’t use FTP!

• Start SFTP program

• Download the files from the web accessible area

o htdocs, public_html, www

• Put the files in the local hard drive

o Desktop

o c:\wamp\www\wordpress

July 18, 2016WordCamp Montreal

Page 22: On the Move - Migrations Made Simple

FTP – Upload and Download

July 18, 2016WordCamp Montreal

Page 23: On the Move - Migrations Made Simple

Confirm Authenticity

July 18, 2016WordCamp Montreal

Page 24: On the Move - Migrations Made Simple

Database

• phpMyAdmin, HeidiSQL, Navicat, MySql Workbench

July 18, 2016WordCamp Montreal

Page 25: On the Move - Migrations Made Simple

July 18, 2016WordCamp Montreal

Page 26: On the Move - Migrations Made Simple

July 18, 2016WordCamp Montreal

Page 27: On the Move - Migrations Made Simple

July 18, 2016WordCamp Montreal

Page 28: On the Move - Migrations Made Simple

Configure wp-config.php

July 18, 2016WordCamp Montreal

Page 29: On the Move - Migrations Made Simple

Configure wp-config.php• Rename wp-config-sample.php to wp-config.php

• Edit wp-config.php with NotePad++, by right clicking the file.

• Change lines 23, 26, 29

/** The name of the database for WordPress */

define('DB_NAME', 'wordpress');

/** MySQL database username */

define('DB_USER', 'root');

/** MySQL database password */

define('DB_PASSWORD', '');

/** MySQL hostname */

define('DB_HOST', 'localhost');

July 18, 2016WordCamp Montreal

Page 30: On the Move - Migrations Made Simple

Change WordPress Location

July 18, 2016WordCamp Montreal

• https://interconnectit.com/products/

search-and-replace-for-wordpress-databases/

Page 31: On the Move - Migrations Made Simple

The Development Stack

7/20/2016EQ WordPress Advanced 31

Page 32: On the Move - Migrations Made Simple

Installation• Text Editor

o Notepad – Included in Windows

o Notepad++ - https://notepad-plus-plus.org/

o Sublime Text 3 - http://www.sublimetext.com/3

o NetBeans - https://netbeans.org/

o PHP Storm - https://www.jetbrains.com/phpstorm/

• Web Browser

o Internet Explorer

o Firefox

o Chrome

o Safari

o Opera

7/20/2016EQ WordPress Advanced 32

Page 33: On the Move - Migrations Made Simple

Stack Installation• LAMP, MAMP, WAMP, XAMP

o Linux, Macintosh, Windows, *

o Apache

o MySQL

o PHP

• Windows

o Wamp Server - http://www.wampserver.com/

• Mac

o MAMP - https://www.mamp.info/en/

• Windows or Mac

o Desktop Server - https://serverpress.com/

7/20/2016EQ WordPress Advanced 33

Page 34: On the Move - Migrations Made Simple

Using WampServer• The “www” directory will be automatically created

o usually c:\wamp\www)

• Create a subdirectory in “www” and put your PHP files

inside

• Click on the “localhost” link in the WampSever menu

• Or

• Open your internet browser and go to the URL :

http://localhost/

7/20/2016EQ WordPress Advanced 34

Page 35: On the Move - Migrations Made Simple

Using WampServer• With a left click on WampServer’s icon, you will be able to:

o manage your Apache and MySQL services

o Switch services online / offline

o install and switch Apache, MySQL and PHP releases

o manage your servers settings

o access your logs

o access your settings files

o create alias

• With a right click:

o change WampServer’s menu language

o Access http://www.wampserver.com

7/20/2016EQ WordPress Advanced 35

Page 36: On the Move - Migrations Made Simple

Transfer Via Duplicator

July 18, 2016WordCamp Montreal

Page 37: On the Move - Migrations Made Simple

http://wpcourse.dawsoncollege.qc.ca/#####

July 18, 2016WordCamp Montreal

Page 38: On the Move - Migrations Made Simple

Install Duplicator

July 18, 2016WordCamp Montreal

Page 39: On the Move - Migrations Made Simple

Create New

July 18, 2016WordCamp Montreal

Page 40: On the Move - Migrations Made Simple

Create New

July 18, 2016WordCamp Montreal

Page 41: On the Move - Migrations Made Simple

Storage Config

July 18, 2016WordCamp Montreal

Page 42: On the Move - Migrations Made Simple

Archive Config

July 18, 2016WordCamp Montreal

Page 43: On the Move - Migrations Made Simple

Installer Config

July 18, 2016WordCamp Montreal

Page 44: On the Move - Migrations Made Simple

Scan Complete

July 18, 2016WordCamp Montreal

Page 45: On the Move - Migrations Made Simple

Building Package

July 18, 2016WordCamp Montreal

Page 46: On the Move - Migrations Made Simple

Package Complete

July 18, 2016WordCamp Montreal

Page 47: On the Move - Migrations Made Simple

See downloaded files

July 18, 2016WordCamp Montreal

Page 48: On the Move - Migrations Made Simple

Create wordpress folder

July 18, 2016WordCamp Montreal

Page 49: On the Move - Migrations Made Simple

Login to the database• Go to http://localhost/phpmyadmin

July 18, 2016WordCamp Montreal

Page 50: On the Move - Migrations Made Simple

Create a new database

1 Create a New

database

2 Give the database

a name: wordpress

o Lowercase

o No spaces – use

underscores

o No special characters

July 18, 2016WordCamp Montreal

Page 51: On the Move - Migrations Made Simple

install.php

July 18, 2016WordCamp Montreal

Page 52: On the Move - Migrations Made Simple

Installer.php

July 18, 2016WordCamp Montreal

Page 53: On the Move - Migrations Made Simple

Processing Files

July 18, 2016WordCamp Montreal

Page 54: On the Move - Migrations Made Simple

Update Files and Database

July 18, 2016WordCamp Montreal

Page 55: On the Move - Migrations Made Simple

Test Site!

July 18, 2016WordCamp Montreal

Page 56: On the Move - Migrations Made Simple

http://localhost/worpress

July 18, 2016WordCamp Montreal

Page 57: On the Move - Migrations Made Simple

Transferring datamany times

July 18, 2016WordCamp Montreal

Page 58: On the Move - Migrations Made Simple

Production

Staging

Dev

July 18, 2016WordCamp Montreal

Process

Page 59: On the Move - Migrations Made Simple

https://deliciousbrains.com

July 18, 2016WordCamp Montreal

Page 60: On the Move - Migrations Made Simple

WP Migrate DB Pro

July 18, 2016WordCamp Montreal

Page 61: On the Move - Migrations Made Simple

WP Migrate DB Pro

July 18, 2016WordCamp Montreal

Page 62: On the Move - Migrations Made Simple

Check your site…

July 18, 2016WordCamp Montreal

Page 63: On the Move - Migrations Made Simple
Page 64: On the Move - Migrations Made Simple

White screen of death?• Update all plugins, themes, and WP core

• Check php version changes

• Deactivate all plugins

• Deactivate the current theme - switch to 2015

• Reset permalinks

• Check .htaccess file – Compare against the codex

• index.html & index.php

• .maintenance

July 18, 2016WordCamp Montreal

Page 65: On the Move - Migrations Made Simple

White screen of death?• Modify wp-config.php - add:

o define(“WP_DEBUG”, true);

o define( “WP_DEBUG_DISPLAY”, true );

• Check the error log

o Accessible via STFP

o CPanel

July 18, 2016WordCamp Montreal

Page 66: On the Move - Migrations Made Simple

Resources

July 18, 2016WordCamp Montreal

Page 67: On the Move - Migrations Made Simple

Resources• https://codex.wordpress.org/Moving_WordPress

• http://www.jasonbobich.com/web-design/

moving-wordpress-to-a-new-server/

July 18, 2016WordCamp Montreal

Page 68: On the Move - Migrations Made Simple

July 18, 2016WordCamp Montreal