Better migrations to CiviCRM

In the CiviCRM world, I’m often known as a migration specialist. I’m glad people think highly of me – but what would REALLY make me happy is if advanced migration techniques were more accessible.
I’ve recently published some updates to my Github repository where I share my migration scripts, and there’s some new scripts I want to share:

Better Error Logs

CiviCRM’s command-line API import logs are overall good – but they refer to the line number of the record in a file.  This makes finding a handful of bad records in a very large file difficult.  My updated CSV API Import script will now correlate the import file with the error logs, so that you can view the error and source data side-by-side.

Script the creation of Custom Fields

Custom fields are difficult to script, because you need to import Custom Groups, drop-down options for fields that don’t allow free entry, etc.  I now have an Import Custom Groups and Fields script to streamline this.  While you can hand-write the field definitions, a better approach is to create them manually, then export them.  You can import your custom fields on to either a blank or existing CiviCRM installation.

Set Allowed Countries and State/Provinces

This script will analyze the postal addresses being imported, and enable only those countries (and corresponding states/provinces) in your CiviCRM installation.

Dump/Load MySQL databases

This is a trivial script, but you can script the loading and saving of your MySQL database while running a script.  This is great for creating/loading a “baseline” database dump, and/or to take point-in-time backups while your migration is in progress.

Leave a Reply

Your email address will not be published. Required fields are marked *