Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

On the Move, Website Migrations Debunked

557 views

Published on

Migrations are a thing we have to do sometimes but dread doing. You ask yourself before, will it go okay? You think later, did I forget anything?

In this talk I’m going to give you some key insights into migrating information from WordPress.com to a WordPress.org self-hosted site. After we’ll discuss the details of migrating a production web site from one host to another. I’ll give you the tools to test the migration before completely flipping the switch. Lastly, we’ll talk about when you want to migrate content from a development copy of the site over to your production site.

Published in: Internet
  • Be the first to comment

  • Be the first to like this

On the Move, Website Migrations Debunked

  1. 1. On The Move Migrations Debunked Jonathan Perlman - @jpurpleman WPCampus 2017 http://jpurpleman.ca/
  2. 2. 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
  3. 3. Dawson College • Nginx • php-fpm • MariaDB July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca • WordPress • Drupal • Moodle • WeBWorK • OpenEdX • MediaWiki • Git with Gitolite-admin
  4. 4. 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
  5. 5. WordPress.com to Self-Hosted July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  6. 6. WordPress.com July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  7. 7. Export From WordPress.com July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  8. 8. Export From WordPress.com July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  9. 9. Import to WordPress.org July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  10. 10. Import to WordPress.org July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  11. 11. 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
  12. 12. General Overview Host to host July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  13. 13. What are we moving? Code HTML, CSS, JS, PHP Media Library JPG, PNG, DOC, PDF Content SQL Database July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  14. 14. 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
  15. 15. 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 )
  16. 16. One-Time Host to Host Transfer July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  17. 17. 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
  18. 18. CPanel based server July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  19. 19. CPanel based server July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  20. 20. Full CPanel backup • homedir o public_html • mysql o site7453prod.sql July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  21. 21. FTP / SFTP • Download the files from the web accessible area o htdocs, public_html, www July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  22. 22. Exporting via phpMyAdmin July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  23. 23. 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
  24. 24. 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
  25. 25. Login to the database July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  26. 26. 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
  27. 27. Listing users having access July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  28. 28. Creating a user July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  29. 29. 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
  30. 30. 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
  31. 31. 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
  32. 32. Importing via phpMyAdmin July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  33. 33. 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
  34. 34. 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
  35. 35. Serialized data July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  36. 36. Change WordPress location July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca https://interconnectit.com/products/ search-and-replace-for-wordpress-databases/
  37. 37. 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’
  38. 38. Examples of Find / Replace Find Replace Path /home/siteedu7453/ /var/www/html/site.edu Protocol http://www.site.edu http://site.edu https://www.site.edu Environment htttps://www.site.edu https://site.dev July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  39. 39. 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
  40. 40. 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/
  41. 41. 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:windowssystem32driversetchosts
  42. 42. 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
  43. 43. 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
  44. 44. 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
  45. 45. 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
  46. 46. 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
  47. 47. Setting Name Servers July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  48. 48. Setting DNS Records July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  49. 49. Playing the waiting game July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  50. 50. Transferring Via Plugins July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  51. 51. Plugin comparison July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca Plugin Single Site vs Multisite Migrates what? Duplicator Single Site Code Media Library Content Backup Buddy UpDraftPlus Single Site Multisite ( with Premium ) All-in-One WP Migration WP Migrate DB Pro Single Site Multisite Media Library Content WP Site Sync
  52. 52. Duplicator July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  53. 53. deliciousbrains.com July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  54. 54. wpsitesync.com July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  55. 55. 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
  56. 56. Resources July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca
  57. 57. 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
  58. 58. Thank you! Questions? Survey! July 15, 2017WPCampus 2017 | https://www.jpurpleman.ca https://2017.wpcampus.org/session-survey/424

×