How to do one-off import or data migration?

Here’s what I would suggest – store your theme version in the database, compare it with your package version, if there’s a difference then load in your upgrade/install operations: define( ‘THEME_PREFIX_VERSION’, ‘X.X’ ); /** * Run upgrade/install. */ function theme_prefix_install() { require_once dirname( __file__ ) . ‘/install.php’; } if ( version_compare( get_option( ‘theme_prefix_version’ ), THEME_PREFIX_VERSION, … Read more

XML importing fails

The issue seems to may be with identical post_date on both a revision and a post. As the data is transferred into the DB, the revision goes first and when the post hits it, the DB sees it as already existing and so does not transfer the actual post. First check: Post type Date I’m … Read more

Weird characters displayed when importing WordPress MySQL db

Can you try setting the DB Charset within wp-config.php? define(‘DB_CHARSET’, ‘utf8_general_ci’); define(‘DB_COLLATE’, ‘utf8_general_ci’); Have a read of this first though: https://codex.wordpress.org/Editing_wp-config.php It can cause problems to an already existing blog to add those lines into wp-config.php, so use with caution. Are you importing this through WordPress or manually through something like PhpMyAdmin? Also, are all … Read more