{"id":4245,"date":"2012-05-11T10:00:47","date_gmt":"2012-05-11T14:00:47","guid":{"rendered":"https:\/\/nuxx.net\/blog\/?p=4245"},"modified":"2012-05-11T10:41:10","modified_gmt":"2012-05-11T14:41:10","slug":"moving-civicrm-on-joomla-to-wordpress","status":"publish","type":"post","link":"https:\/\/nuxx.net\/blog\/2012\/05\/11\/moving-civicrm-on-joomla-to-wordpress\/","title":{"rendered":"Moving CiviCRM on Joomla to WordPress"},"content":{"rendered":"<p>With recent work done on the <a href=\"http:\/\/mmba.org\">MMBA website<\/a> I&#8217;ve had to move the <a href=\"http:\/\/civicrm.org\">CiviCRM<\/a> instance from an older copy hosted on <a href=\"http:\/\/joomla.org\">Joomla<\/a> to a new one hosted on <a href=\"http:\/\/wordpress.org\">WordPress<\/a>. 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.<\/p>\n<p>This copy of CiviCRM wasn&#8217;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.<\/p>\n<p>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:<\/p>\n<blockquote><p>1) Install <a href=\"http:\/\/wordpress.org\">WordPress<\/a> and the <a href=\"http:\/\/civicrm.org\">CiviCRM<\/a> plugin with the new installation of CiviCRM going to a different database or table prefix than the current.<\/p>\n<p>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.<\/p>\n<p>3) Using <a href=\"http:\/\/www.phpmyadmin.net\">phpMyAdmin<\/a> export all CiviCRM tables to a <tt>.sql<\/tt> file except for:<\/p>\n<blockquote><p><tt>civicrm_acl_cache<\/tt><br \/>\n<tt>civicrm_acl_contact_cache<\/tt><br \/>\n<tt>civicrm_domain<\/tt><br \/>\n<tt>civicrm_cache<\/tt><br \/>\n<tt>civicrm_group_contact_cache<\/tt><\/p><\/blockquote>\n<p>With the option: <em>Add <tt>DROP TABLE<\/tt> \/ <tt>VIEW<\/tt> \/ <tt>PROCEDURE<\/tt> \/ <tt>FUNCTION<\/tt> \/ <tt>EVENT<\/tt> statement<\/em>.<\/p>\n<p>4) To avoid issues with Foreign Key Constraints add this line to the top of the <tt>.sql<\/tt> file:<\/p>\n<blockquote><p><tt>SET foreign_key_checks = 0;<\/tt><\/p><\/blockquote>\n<p>And this to the bottom:<\/p>\n<blockquote><p><tt>SET foreign_key_checks = 1;<\/tt><\/p><\/blockquote>\n<p>5) If the new set of tables has a different prefix than the old, search\/replace in the <tt>.sql<\/tt> to change each table name to the prefix used by the WordPress-based CiviCRM instance.<\/p>\n<p>6) Import the <tt>.sql<\/tt> into the WordPress-based CiviCRM database using the MySQL command line utility:<\/p>\n<blockquote><p><tt>mysql -u username -p databasename < civicrm_export.sql<\/tt><\/p><\/blockquote>\n<p>7) Enter the CiviCRM plugin in WordPress and confirm that all the contacts have been moved over.<\/p><\/blockquote>\n<p>These steps were performed on the following configuration:<\/p>\n<blockquote><p>- Apache\/2.2.22 (FreeBSD) mod_ssl\/2.2.22 OpenSSL\/0.9.8q mod_fastcgi\/2.4.6<br \/>\n- MySQL 5.5.22 (from <a href=\"http:\/\/www.freebsd.org\/ports\">FreeBSD Ports<\/a>)<br \/>\n- WordPress 3.3.2 w\/ CiviCRM 4.1.0<br \/>\n- Joomla 1.5.24 w\/ CiviCRM 3.4.7<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>With recent work done on the MMBA website I&#8217;ve had to move the CiviCRM instance from an older copy hosted on Joomla to a new&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/nuxx.net\/blog\/2012\/05\/11\/moving-civicrm-on-joomla-to-wordpress\/\">Continue reading<span class=\"screen-reader-text\">Moving CiviCRM on Joomla to WordPress<\/span><\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-4245","post","type-post","status-publish","format-standard","hentry","category-computers","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/4245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/comments?post=4245"}],"version-history":[{"count":11,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/4245\/revisions"}],"predecessor-version":[{"id":4256,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/4245\/revisions\/4256"}],"wp:attachment":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/media?parent=4245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/categories?post=4245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/tags?post=4245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}