on the move, website migrations debunked

59
On The Move Migrations Debunked Jonathan Perlman - @jpurpleman WPCampus 2017 http://jpurpleman.ca/

Upload: jonathan-perlman

Post on 23-Jan-2018

286 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: On the Move, Website Migrations Debunked

On The MoveMigrations Debunked

Jonathan Perlman - @jpurpleman

WPCampus 2017

http://jpurpleman.ca/

Page 2: On the Move, Website Migrations Debunked

About me• Canadian, eh! Montreal, Quebec

• Senior web developer at Dawson College

• Teacher at Dawson College’s CTD ( non-credit )

• WordCamp speaker

• Excel super-geek as per

Chris Lema

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 3: On the Move, Website Migrations Debunked

Dawson College• Nginx

• php-fpm

• MariaDB

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

• WordPress

• Drupal

• Moodle

• WeBWorK

• OpenEdX

• MediaWiki

• Git with Gitolite-admin

Page 4: On the Move, Website Migrations Debunked

What’s covered…

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

• WordPress.com to self-hosted

• General overview

• One-time transfer

• Continuous migration

• DNS

• Check your site

• Resources

Page 5: On the Move, Website Migrations Debunked

WordPress.comto

Self-Hosted

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 6: On the Move, Website Migrations Debunked

WordPress.com

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 7: On the Move, Website Migrations Debunked

Export From WordPress.com

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 8: On the Move, Website Migrations Debunked

Export From WordPress.com

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 9: On the Move, Website Migrations Debunked

Import to WordPress.org

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 10: On the Move, Website Migrations Debunked

Import to WordPress.org

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 11: On the Move, Website Migrations Debunked

Post Import• Theme

o Theme Directory – https://wordpress.org/theme

o Custom development ?

• Plugins

o Plugin Directory – https://wordpress.org/plugins

o JetPack

o Custom development ?

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 12: On the Move, Website Migrations Debunked

General Overview

Host to host

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 13: On the Move, Website Migrations Debunked

What are we moving?

CodeHTML, CSS,

JS, PHP

Media Library

JPG, PNG, DOC, PDF

Content SQL Database

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 14: On the Move, Website Migrations Debunked

Doing the migration• Login to old host and download the WordPress site and

export MySQL database

• Login to new host and create a MySQL database

• Change wp-config.php locally within the WordPress

installation files

• Upload the WordPress site onto the new host and import

MySQL database

• Change Site URL and Site Path within the database

• Change your hosts file and test the site

• Change the DNS and wait

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 15: On the Move, Website Migrations Debunked

Required Tools• Command line ( SSH )

o tar, scp, sed

o vim

o wp-cli

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

• File Transfer Program

o FileZilla

• Database client

o phpMyAdmin

o HeidiSQL

• ( Windows only )

o Sequel Pro

• ( Mac only )

Page 16: On the Move, Website Migrations Debunked

One-Time Host to Host

Transfer

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 17: On the Move, Website Migrations Debunked

Doing the migration• Login to old host and download the WordPress site and export

MySQL database

• Login to new host and create a MySQL database

• Change wp-config.php locally within the WordPress

installation files

• Upload the WordPress site onto the new host and import

MySQL database

• Change Site URL and Site Path within the database

• Change your hosts file

• Check your site on the new host for errors

• Change the DNS and wait

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 18: On the Move, Website Migrations Debunked

CPanel based server

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 19: On the Move, Website Migrations Debunked

CPanel based server

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 20: On the Move, Website Migrations Debunked

Full CPanel backup• homedir

o public_html

• mysql

o site7453prod.sql

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 21: On the Move, Website Migrations Debunked

FTP / SFTP• Download the files from the web accessible area

o htdocs, public_html, www

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 22: On the Move, Website Migrations Debunked

Exporting via phpMyAdmin

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 23: On the Move, Website Migrations Debunked

Exporting via command line• WP-CLI

o wp db export

• Raw MySQL Command

o mysqldump -u root -pPASSWORD \

--complete-insert \

--skip-extended-insert \

--max_allowed_packet=512M \

-B site_edu > site_edu.sql

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 24: On the Move, Website Migrations Debunked

Doing the migration• Login to old host and download the WordPress site and export

MySQL database

• Login to new host and create a MySQL database

• Change wp-config.php locally within the WordPress

installation files

• Upload the WordPress site onto the new host and import

MySQL database

• Change Site URL and Site Path within the database

• Change your hosts file

• Check your site on the new host for errors

• Change the DNS and wait

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 25: On the Move, Website Migrations Debunked

Login to the database

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 26: On the Move, Website Migrations Debunked

Create a new database

1 Create a New

database

2 Give the database

a name

o Lowercase

o No spaces – use

underscores

o No special characters

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 27: On the Move, Website Migrations Debunked

Listing users having access

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 28: On the Move, Website Migrations Debunked

Creating a user

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 29: On the Move, Website Migrations Debunked

Doing the migration• Login to old host and download the WordPress site and export

MySQL database

• Login to new host and create a MySQL database

• Change wp-config.php locally within the WordPress

installation files

• Upload the WordPress site onto the new host and import

MySQL database

• Change Site URL and Site Path within the database

• Change your hosts file

• Check your site on the new host for errors

• Change the DNS and wait

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 30: On the Move, Website Migrations Debunked

Change wp-config.php• Edit wp-config.php with a text editor

• Change lines ~ 23, 26, 29 start with "define"

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

define('DB_NAME', ‘');

/** MySQL database username */

define('DB_USER', ‘');

/** MySQL database password */

define('DB_PASSWORD', '');

/** MySQL hostname */

define('DB_HOST', 'localhost');

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 31: On the Move, Website Migrations Debunked

Doing the migration• Login to old host and download the WordPress site and export

MySQL database

• Login to new host and create a MySQL database

• Change wp-config.php locally within the WordPress

installation files

• Upload the WordPress site onto the new host and import

MySQL database

• Change Site URL and Site Path within the database

• Change your hosts file

• Check your site on the new host for errors

• Change the DNS and wait

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 32: On the Move, Website Migrations Debunked

Importing via phpMyAdmin

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 33: On the Move, Website Migrations Debunked

Importing via command line• WP-CLI

o wp db import

• Raw MySQL Command

o mysql -u root -pPASSWORD \

--max_allowed_packet=512M

site_edu < site_edu.sql

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 34: On the Move, Website Migrations Debunked

Doing the migration• Login to old host and download the WordPress site and export

MySQL database

• Login to new host and create a MySQL database

• Change wp-config.php locally within the WordPress

installation files

• Upload the WordPress site onto the new host and import

MySQL database

• Change Site URL and Site Path within the database

• Change your hosts file

• Check your site on the new host for errors

• Change the DNS and wait

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 35: On the Move, Website Migrations Debunked

Serialized data

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 36: On the Move, Website Migrations Debunked

Change WordPress location

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

https://interconnectit.com/products/

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

Page 37: On the Move, Website Migrations Debunked

Change WordPress location

Single Site Multi-Site

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

wp search-replace

‘http://example.com’

‘http://example.dev’

wp search-replace

--url=http://example.com

‘http://example.com’

‘http://example.dev’

Page 38: On the Move, Website Migrations Debunked

Examples of Find / Replace

Find Replace

Path /home/siteedu7453/ /var/www/html/site.edu

Protocolhttp://www.site.eduhttp://site.edu

https://www.site.edu

Environment htttps://www.site.edu https://site.dev

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 39: On the Move, Website Migrations Debunked

Doing the migration• Login to old host and download the WordPress site and export

MySQL database

• Login to new host and create a MySQL database

• Change wp-config.php locally within the WordPress

installation files

• Upload the WordPress site onto the new host and import

MySQL database

• Change Site URL and Site Path within the database

• Change your hosts file

• Check your site on the new host for errors

• Change the DNS and wait

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 40: On the Move, Website Migrations Debunked

Override your DNS

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

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

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

Page 41: On the Move, Website Migrations Debunked

Windows

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

• 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 42: On the Move, Website Migrations Debunked

Mac• 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 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 43: On the Move, Website Migrations Debunked

Doing the migration• Login to old host and download the WordPress site and export

MySQL database

• Login to new host and create a MySQL database

• Change wp-config.php locally within the WordPress

installation files

• Upload the WordPress site onto the new host and import

MySQL database

• Change Site URL and Site Path within the database

• Change your hosts file

• Check your site on the new host for errors

• Change the DNS and wait

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 44: On the Move, Website Migrations Debunked
Page 45: On the Move, Website Migrations Debunked

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

• Check php version changes

• Deactivate all plugins and reactivate them one-by-one

• Deactivate the current theme - switch to 2017

• Reset permalinks

• Check .htaccess file – Compare against the codex

• index.html & index.php

• .maintenance

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 46: On the Move, Website Migrations Debunked

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 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 47: On the Move, Website Migrations Debunked

Doing the migration• Login to old host and download the WordPress site and export

MySQL database

• Login to new host and create a MySQL database

• Change wp-config.php locally within the WordPress

installation files

• Upload the WordPress site onto the new host and import

MySQL database

• Change Site URL and Site Path within the database

• Change your hosts file

• Check your site on the new host for errors

• Change the DNS and wait

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 48: On the Move, Website Migrations Debunked

Setting Name Servers

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 49: On the Move, Website Migrations Debunked

Setting DNS Records

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 50: On the Move, Website Migrations Debunked

Playing the waiting game

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 51: On the Move, Website Migrations Debunked

Transferring Via Plugins

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 52: On the Move, Website Migrations Debunked

Plugin comparison

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Plugin Single Site vs Multisite Migrates what?

Duplicator

Single SiteCode

Media Library

Content

Backup Buddy

UpDraftPlusSingle Site

Multisite ( with Premium )All-in-One WP

Migration

WP Migrate DB ProSingle SiteMultisite

Media Library

ContentWP Site Sync

Page 53: On the Move, Website Migrations Debunked

Duplicator

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 54: On the Move, Website Migrations Debunked

deliciousbrains.com

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 55: On the Move, Website Migrations Debunked

wpsitesync.com

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 56: On the Move, Website Migrations Debunked

Pros / Cons

Pros Cons

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

• Super user friendly

• Export site to the cloud

• Automates the process

• Finds and replaces

• Not multi-site friendly

• Timeouts on larger sites

• Can’t use CloudFlare

while duplicating

• May require changes to

.htaccess

• Files might need to go in

non-standard directories

Page 57: On the Move, Website Migrations Debunked

Resources

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 58: On the Move, Website Migrations Debunked

Resources• http://www.wpbeginner.com/wp-tutorials/

how-to-move-wordpress-to-a-new-host-or-server-

with-no-downtime/

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

• https://wordpress.org/support

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

Page 59: On the Move, Website Migrations Debunked

Thank you! Questions? Survey!

July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca

https://2017.wpcampus.org/session-survey/424