5. Ivan@Kruchkoff.com https://github.com/ivankruchkoff/wp-bigmig
The Problem Statement
• Acme corp is frustrated using BoringCMS:
• Editorial find the interface horrible to use
• The performance is incredibly slow
• Countless hours spent keeping the CMS running
• They've evaluated other options and have decided
on WordPress.
• Your team is responsible for getting them there.
14. Ivan@Kruchkoff.com https://github.com/ivankruchkoff/wp-bigmig
Update and Improve Posts
Parser
• Start with a few content exports, ideally as JSON
• Find your unique identifier (ID / File Path)
• Parse the wp_posts fields first:
• post_author, post_date/post_modified, post_content ,
post_title, post_name, post_parent, guid, post_type
• Log all the things
• Any time an error occurs, pause handling this file, log a
message, move to /investigate, continue to next file.
15. Ivan@Kruchkoff.com https://github.com/ivankruchkoff/wp-bigmig
Import Posts
• First few runs, ignore the data.
• Create four folders:
• pending - any file we haven't yet read / processed
• processed - files that were successfully imported into WP.
• ignored - files that aren't being handled by WP
• investigate - files that should be handled by WP, but threw an
error.
• Log every step
17. Ivan@Kruchkoff.com https://github.com/ivankruchkoff/wp-bigmig
Code Structure
• WP Cli command
• File parser, this takes a text file and makes it a PHP
data type (json_decode( file_get_contents( $fn) )
• Content Parser, marshalls data from old format into
something that can be used to create a post.
• Post, contains params for wp_insert_post()
post_meta array and taxonomy terms
26. Ivan@Kruchkoff.com https://github.com/ivankruchkoff/wp-bigmig
Speeding Up the Process
• What are your bottlenecks? Latency everywhere
• Reading from a local disk / networked disk / ram
• Reading / writing from a local db / networked db.
• Replication to read nodes.
• Single Process
• Term counting etc. - look at 10up Best Practices :)