When migrating a WordPress site between environments, it’s difficult to know for certain whether the task completed successfully.

Proposed Algorithm

Just like the md5 algorithm lets us produce a shorthand representation of a file, we could create a WP-CLI command to produce a manifest file representing a certain calculation of WordPress’ state.

This manifest file could contain data on:

  • Number of posts, users, attachments, comments, etc.
  • Checksums of files in the wp-content directory.
  • Number of files in the uploads directory and total size.
  • Random assortment of attachment files to verify.

After you run the migration, you’d compare the pre-migration manifest file with the post-migration manifest file to determine whether the migration happened correctly.