0

Similar to the behavior of this Upgrading WP to 5.0.1 deletes civicrm uploads folder, I had deactivated then decided to delete a site on our WP multisite. Once I clicked delete I got a fatal error (sorry I did not copy) that referenced line 916 of civicrm.php file. Deactivating CiviCRM plugin got the multisite backup.

require_once 'CRM/Core/ClassLoader.php';
      CRM_Core_ClassLoader::singleton()->register();

Then I saw that the uploads/civicrm folder was empty. It had the /ext /uploads and /template_c folder but they were all empty. The rest were gone.

We restored the directory from backup and now it works. Anyways, this is a word of caution.

Question is, why did this happen?

  • was the /uploads/sites/ folder somehow symlinked to /uploads/civicrm ? – Kevin Cristiano Apr 16 at 17:30
  • Yes,symlinks are still in /uploads/sites/XX. Those symlinks should be removed, right? – Andy Burns Apr 16 at 17:44
  • I'd test it first, but Yes, I think the symlinks are the issue. If WP follows the link when deleting the site it will remove files it should not. This does bring up a point that we should ensure the documentation is correct on docs.civicrm.org as well. – Kevin Cristiano Apr 17 at 20:13
1

Deleting a site in WP triggers deleting sites/nn/uploads folder contents. Unfortunately, that site still had a civicrm symlink pointing to /uploads/civicrm which the delete trigger followed and subsequently deleted.

Don't use symlinks. I removed without issue. Instead you can define resource paths in civicrm.settings.php file. Will take a look at updating docs.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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