civicrm_drush
Security covered
The CiviCRM Drush module provides comprehensive command-line tools for managing CiviCRM installations on Drupal. This module provides Drush 9, 10, 11, and 12 support for CiviCRM drush actions, for Drupal 8, Drupal 9, Drupal 10, and Drupal 11. Originally developed by Skvare to continue Drush support for modern Drupal versions, this module allows developers and system administrators to perform CiviCRM operations efficiently from the command line.
Key Features
CiviCRM Management Commands
- API Access: Direct command-line access to CiviCRM's extensive API system
- Extension Management: Install, disable, enable, and list CiviCRM extensions
- Database Operations: Validate database integrity and perform upgrades
- Mail Processing: Handle CiviMail queues and batch processing
- Cache Management: Clear and flush CiviCRM caches for optimal performance
- Member Records: Process membership record updates via cron
Installation
Install as you would normally install a contributed Drupal module. Visit https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-mod... for further information.
composer require drupal/civicrm_drush
USAGE
civicrm:api (cvapi) CLI access to CiviCRM APIs.
civicrm:db-validate Valid CiviCRM Database.
civicrm:disable-debug Disable CiviCRM Debugging.
civicrm:enable-debug Enable CiviCRM Debugging.
civicrm:ext-disable (ced) Disable a CiviCRM extension.
civicrm:ext-install (cei) Install a CiviCRM extension.
civicrm:ext-list (cel) List of CiviCRM extensions enabled.
civicrm:ext-uninstall (ceui) Uninstall a CiviCRM extension.
civicrm:member-records Run the CiviMember UpdateMembershipRecord cron (civicrm-member-records).
civicrm:process-mail-queue Process pending CiviMail mailing jobs.
civicrm:rest (cvr) Rest interface for accessing CiviCRM APIs.
civicrm:restore Restore CiviCRM codebase and database back from the specified backup dir.
civicrm:route-rebuild Adds a route rebuild option for CiviCRM.
civicrm:update-cfg (cvupcfg) Update config_backend to correct config settings.
civicrm:upgrade (cvup) Replace CiviCRM codebase with new specified tarfile and upgrade database.
civicrm:upgrade-db (cvupdb) Execute the civicrm/upgrade?reset=1 process from the command line.
civicrm:flush-cache (cvflush) Flush CiviCRM Cache.
Removed in 3.X Version
civicrm:sql-cli (cvsqlc) Open a SQL command-line interface using CiviCRM's credentials.
civicrm:sql-conf Print CiviCRM database connection details.
civicrm:sql-connect A string for connecting to the CiviCRM DB.
civicrm:sql-dump Exports the CiviCRM DB as SQL using mysqldump.
civicrm:sql-query Execute a query against the CiviCRM database. Requirements
- Drupal: 8.x, 9.x, 10.x, or 11.x (depending on module version)
- CiviCRM: 5.x or later
- Drush: 9.x, 10.x, 11.x, or 12.x (depending on module version)
- PHP: Version compatible with your Drupal and CiviCRM installations
Getting Help
For support or to learn more about implementing this module:
- Contact Skvare for professional support
- Submit issues and feature requests in the project's issue queue