3

I originally installed CiviCRM in Wordpress on our regular website. I am now wanting to uncomplicate that website by moving our CiviCRM installation to another subdomain so it can be used separately from our main website in a second Wordpress installation. I haven't been able to find a recommended procedure for our specific use case.

Note: CiviCRM is installed in a separate database from Wordpress already. The new subdomain is currently empty.

Edit, clarification, and question based on the answer below:

We do have links to the newsletter subscription form. And we have the admin utilities plugin installed. I also have some custom roles created.

I am planning to run Wordpress in the subdomain using the same host as the current site, so the CiviCRM database itself doesn't necessarily have to move.

I was wondering if it would be possible to simply disable the civicrm plugin, copy the existing website over to the new location, duplicating the database for wordpress, but using the existing database for CiviCRM. Perform whatever find/replace was necessary to change domain.com to new.domain.com, and then re-enable CiviCRM? If that could work, I'd just need some idea of what find/replace would be necessary.

2 Answers 2

2

OK. I did find William's answer helpful, but ultimately this is roughly what I did. I did it this way so I wouldn't have to spend time worrying about configuring a new Wordpress install to exactly match all the features of my current one with relation to CiviCRM:

  1. I backed up everything!
  2. Disabled the CiviCRM Admin Utilites and CiviCRM plugins (in that order, apparently, or I got a fatal error) Created the new subdomain and a new Wordpress (WP) database
  3. Exported the WP and CiviCRM databases
  4. Performed a find/replace on each extracted database, somewhat painstakingly, to switch any appropriate references from the old example.org to new.example.org
  5. Imported the modified WP database to the new database I created for it
  6. Imported the modified CiviCRM database to overwrite the original copy (which I had backed up just in case!) Transferred the files from the live WP site to the new domain
  7. Updated the CiviCRM civicrm.settings.php file in the wp-content/uploads/civicrm folder to change hard coded references from the old example.org to new.example.org, and a few paths that were also hard coded to the file system that looked like "/home/username/www/subdomain-name/wp-content/plugins/civicrm/civicrm/)
  8. I followed some of the steps in this document to delete some cached files and rebuild cache and menus. I also ended up having to go to the status page which directed me to update Stripe hooks.
  9. Once I was sure things were working well I performed some cleanup on the old website to remove the CiviCRM and CiviCRM Admin Utilities plugin files.
  10. I removed unnecessary WP content on the new website that had transferred over from the old website.
  11. I updated the CRON job in my hosting panel to point to the new installation.
1
  • Thanks for sharing the steps you took. This could be useful for others trying to do the same. Dec 31, 2022 at 12:11
1

If I understand you correctly, you currently have CiviCRM installed within your main (WordPress) website. You would like to move the CiviCRM instance from your main website and to a separate WordPress instance on a subdomain.

The answer to this really depends on how complex you existing installation is and how much it integrates with your WordPress website.

I would suggest that you start by reviewing your existing installation to check for any integration between WordPress and CiviCRM.

  • Do you have any public forms on your website that store data in CiviCRM? e.g. a donation form or newsletter sign up
  • Do you have any pages that show data from CiviCRM? e.g. a list of current members or recent donors
  • Does access to your site users depend on data from CiviCRM? e.g. are parts of the site member-only?
  • Do you have any WordPress plugins that interact with CiviCRM? e.g. Member Sync, Groups Sync, Caldera Forms etc.

If you have answered 'yes' to any of the above, you will need to ensure that you recreate this functionality on the new site.

Presuming that your site is relatively simple and you don't have any of the integration listed above, it should be fairly straightforward to move your installation of CiviCRM from one WordPress site to another.

You should be able to follow the same steps as if you were switching from Drupal to WordPress. You will be switching from WordPress to WordPress but the steps are the same.

I'd suggest you also read the documentation on switching servers.

I strongly recommend that you do a test run on a staging server first to make sure that it works correctly.

EDIT

You've asked if you could simply duplicate the existing site. Yes, that should work fine. You could then disable/remove any WordPress functionality that you don't need from the new copy and remove CiviCRM from the original site.

In terms of updating the URL you can find details of the changes you need to make in the sysadmin guide. You will also need to update the URLs in the WordPress database see this support article for details.

3
  • I have updated the question based on this answer. Please see my response there.
    – Joshua K
    Dec 27, 2022 at 19:25
  • @JoshuaK could you clarify some of the details that you mentioned? Was the newsletter sign up form created using CiviCRM or WordPress? If it is a CiviCRM form it should be fine. The admin utilities plugin shouldn't cause any issues. Do the custom roles depend on any data in CiviCRM - e.g. membership status? If not, that shouldn't be an issue. Dec 30, 2022 at 17:44
  • The newsletter sign up form we're using is the default page generated by CiviCRM and it seems to work fine after the move. The custom roles were created using User Role Editor so that I could create different users that have specific capabilities in CiviCRM.
    – Joshua K
    Dec 30, 2022 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.