Press "Enter" to skip to content

Moving CiviCRM on Joomla to WordPress

With recent work done on the MMBA website I’ve had to move the CiviCRM instance from an older copy hosted on Joomla to a new one hosted on WordPress. The general suggestion for doing this is to export and import the data, but this is both a bit frustrating to do (because of a need to specify which columns contain which fields) and PHP kept running out of memory when exporting, even after I moved it up to 256MB per process.

This copy of CiviCRM wasn’t really used, but it did have a lengthy set of contacts that I could not afford to lose. Thus, I looked into what was necessary to move the tables themselves instead of just exporting/importing the data.

I ended up using these steps to get the contact data moved over and it seemed to work well for me. This may not be the best way to do it, and it may introduce some problems down the line, but this did work for me and seems fine thus far, so I wanted to document the steps here:

1) Install WordPress and the CiviCRM plugin with the new installation of CiviCRM going to a different database or table prefix than the current.

2) Ensure that the WordPress CiviCRM plugin works, only going as far as the first screen which prompts to set up an organization name, email addresses, etc.

3) Using phpMyAdmin export all CiviCRM tables to a .sql file except for:

civicrm_acl_cache
civicrm_acl_contact_cache
civicrm_domain
civicrm_cache
civicrm_group_contact_cache

With the option: Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement.

4) To avoid issues with Foreign Key Constraints add this line to the top of the .sql file:

SET foreign_key_checks = 0;

And this to the bottom:

SET foreign_key_checks = 1;

5) If the new set of tables has a different prefix than the old, search/replace in the .sql to change each table name to the prefix used by the WordPress-based CiviCRM instance.

6) Import the .sql into the WordPress-based CiviCRM database using the MySQL command line utility:

mysql -u username -p databasename < civicrm_export.sql

7) Enter the CiviCRM plugin in WordPress and confirm that all the contacts have been moved over.

These steps were performed on the following configuration:

- Apache/2.2.22 (FreeBSD) mod_ssl/2.2.22 OpenSSL/0.9.8q mod_fastcgi/2.4.6
- MySQL 5.5.22 (from FreeBSD Ports)
- WordPress 3.3.2 w/ CiviCRM 4.1.0
- Joomla 1.5.24 w/ CiviCRM 3.4.7

2 Comments

  1. Tommy Scully
    Tommy Scully June 11, 2012

    Are you available for hire?
    I’m the tech director for the ministry Power and Love. We use CiviCRM to manage our events and emails. We are currently on an instance of Joomla 1.5 and would like to move to wordpress but have had no luck in finding developers who have done this before. Please call me if you are interested, we have money budgeted for this migration.
    Tommy Scully
    Power & Love Media and Technology Coordinator
    615-719-9363 office
    615-934-9683 cell

  2. c0nsumer
    c0nsumer June 11, 2012

    Tommy Scully: Thanks for the offer, but at this point I’m a bit too busy to take on this sort of work. I’m sorry. I can tell you that when I moved mmba.org from Joomla to WordPress most of the heavy lifting (read: article moving) was done using the Joomla/Mambo to WordPress Migrator plugin. I then just had to go through and delete all the irrelevant articles and work on the theme.

Leave a Reply