Questions tagged [drush]

Drush is a command line shell and Unix scripting interface for Drupal. CiviCRM for Drupal ships with a drush extension with a number of CiviCRM specific commands.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

Drupal 9 doesn't parse DSN via drush

We ran into an issue and I'm curious if others have as well. We are running CiviCRM (5.61.4) on Drupal 9. Our DB is hosted on a different server from the application. From the UI, Civi is working fine....
lcdservices's user avatar
0 votes
0 answers
28 views

Cannot declare class CRM_Core_ClassLoader, because the name is already in use

I have just upgraded to Drupal 9.4.7 after successfully checking that CiviCRM and Drupal were working on PHP 8 (8.0.20). I am running CiviCRM 5.51.1. When I run the command drush updb I get the ...
Josh's user avatar
  • 857
1 vote
1 answer
152 views

drush error message: CiviCRM: System: Please specify a realistic site URL (Ex: drush -l http://example.com:456 ...)

After upgrading Drupal from 8.9 to 9.2 for several weeks I always get following error message when I use the command drush upgradedb CiviCRM: System: Please specify a realistic site URL (Ex: drush -l ...
paul77's user avatar
  • 11
0 votes
1 answer
95 views

Drush cannot locate CRM/Core/ClassLoader.php

I'm trying to configure Drush on my shared host and any time I try to do anything it fails as follows: bash-3.2$ drush cache-clear all require_once(CRM/Core/ClassLoader.php): failed to open stream: No ...
somnolentsurfer's user avatar
0 votes
1 answer
212 views

Call to undefined function civicrm_initialize() in sites/all/modules/contrib/civicrm_entity/civicrm_entity.module:488

I've just updated Drupal core (to 7.75) and found my site was stuck in maintenance mode, even after it was unticked in configuration. I've had this before and always been able to get round it with a ...
somnolentsurfer's user avatar
1 vote
1 answer
120 views

How do I access drush commands specific to CiviCRM?

I have installed CiviCRM 5.31 on Drupal 8 with the following set of commands according to the official Drupal and CiviCRM documentation: cd /var/www composer create-project drupal/recommended-project:...
Quasimodo's user avatar
  • 113
0 votes
0 answers
144 views

Can't upgrade drush with composer

For upgrading CiviCRM, I've been told that it is safer to upgrade with drush than manually, but my version of drush, according to another post, has to be upgraded from 8.0.0 to 8.4.5. (See Command &...
Pierre François's user avatar
0 votes
0 answers
145 views

Command "drush vset maintenance_mode 1" gives me an error

Issuing the command drush vset maintenance_mode 1 gives me an error: Deprecated function: Array and string offset access syntax with curly[error] braces is deprecated in include_once() (line 20 of /...
Pierre François's user avatar
2 votes
1 answer
107 views

Can't upgrade from 5.26.* to 5.28.*

We got 2 demo websites that we are using publicly to show translations. When I tried to update them, they returned from drush command the following: Drush bootstrap phase : bootstrap_drupal_database() ...
Experiance Tranquility's user avatar
2 votes
2 answers
114 views

how to drop all civicrm tables using drush?

Civi is using it's own (not shared with Drupal) database. During a script to rebuild a dev/test site from production data I want to drop all the tables in the civi dev db. How do I do that? After ...
alec's user avatar
  • 407
3 votes
0 answers
79 views

Get list of extensions with upgrades available (from command line)

I would like to know if it is possible to use the command-line to get a list of extensions that have upgrades available. I want to then use that to run cvapi extension.download to install the updates. ...
Sleewok's user avatar
  • 1,146
1 vote
1 answer
56 views

Disabling Scheduled Jobs, Transactions, etc (from command line)?

I'm working on migrating our site to a different server. I need to do some testing on the new server while keeping the production site live. The problem is that the test server continues to run all ...
Sleewok's user avatar
  • 1,146
1 vote
2 answers
91 views

Civi 5.x not recognizing PHP 7.1 in Drush

This is the second site I've noticed this on - in both cases, the site is running PHP 7.1.32, as reported on the Drupal system status page. Error message: CiviCRM requires PHP 7.0.0+. The web ...
Billyjames's user avatar
2 votes
1 answer
186 views

Need help with export.php (CiviCRM 4.6 & Drupal 7)

I'm using an older version of CiviCRM (4.6) with Drupal 7 on Linux and until now I've not really used the command line stuff for CiviCRM, only for Drupal. But I now need to do exports & imports ...
Neil's user avatar
  • 21
0 votes
1 answer
49 views

Cron job has started producing output

I have a cron job /www/www/job.execute.sh That runs the civiCRM scheduled tasks: #!/bin/sh drush -r /home/crwheelmen/www/www --quiet civicrm-api job.execute This has been running successfully ...
Jack Donohue's user avatar
1 vote
1 answer
112 views

Define CIVICRM_LOGGING_DSN in PHP?

Is it possible to use PHP to define the CIVICRM_LOGGING_DSN setting located in civicrm.settings.php? We are using Drupal. I have successfully used the following to change some settings before: Civi:...
Sleewok's user avatar
  • 1,146
4 votes
0 answers
34 views

Why when upgrading civi via drush I always get You are already upgraded to CiviCRM version-I'm-upgrading-from?

I saw a bug out there on this but it's old and claims to be fixed. I keep thinking the next time I do an upgrade, it'll be fixed. So for example: upgrading from 5.9.1 to 5.10.0 drush civicrm-...
Paul-Tahoe's user avatar
  • 2,933
1 vote
2 answers
149 views

Drush sql-sync and civicrm issue

I wanted to quickly pull all the data (contacts, custom types, etc) from one Drupal CiviCRM install to another. I got a little too clever for myself and used Drush sql-sync to do it. It failed. As I ...
tanbog's user avatar
  • 317
1 vote
1 answer
28 views

Error using Drush and Civi API when adding data to a custom field with multi-select data

I have been trying to create contacts data using Drush and the CiviAPI. I get an error when I try to add data to a multi-select field despite using exactly the same syntax that the API explorer gives ...
ChumKui's user avatar
  • 569
1 vote
0 answers
28 views

Please download Drush error when trying to execute CiviHR install script

I'm attempting to install CiviHR as per these instructions: https://github.com/compucorp/civihr-installer I'm using a GoDaddy shared linux server to install this on - but I have an issue. I've ...
John Bell's user avatar
  • 111
2 votes
2 answers
55 views

Is it possible to set the list of CiviCRM components from the command line using drush

drush and cv have both have commands to install extensions. But know I want to create a script that sets the CiviCRM components. Is it possible to do this?
Kainuk - CiviCooP's user avatar
2 votes
2 answers
420 views

Error: Cron Not Running

For several months we have been seeing the error "Cron Not Running". I have repeatedly configured crontab for the root user, and currently have the following: 0 * * * * wget -O - -q -t 1 https://<...
Brylie Christopher Oxley's user avatar
3 votes
0 answers
25 views

How are API calls logged consistently as a specific user?

I wrote some extensive scripts that are run through drush. I use the --user= switch in the drush command that supposedly runs the script as that user. The chosen user has a CiviCRM contact ID too ...
ñull's user avatar
  • 1,208
4 votes
2 answers
804 views

How do I use cv to run database upgrades from the command line?

I'd like to run the database upgrades from the command line. I know I can do with with drush civicrm-upgrade-db but I'd like to know a way to do it in a CMS-agnostic way (that will work for Wordpress ...
Sean's user avatar
  • 3,158
0 votes
1 answer
106 views

Drush civicrm-install failing with 'undefined function module_enable'

I'm using Drush 8, Drupal 7 and CiviCRM 4.7.18 The civicrm.drush.inc file that comes with CiviCRM (and is moved to ~/.drush/) has a call to a function called module_enable() which is not defined ...
JorgeeFG's user avatar
  • 179
2 votes
1 answer
91 views

How can I download CiviCRM tar file with Drush?

Is there a way I can automatize this download in order to use drush civicrm-install I'm trying to automatize deployment of CiviCRM in Drupal 7
JorgeeFG's user avatar
  • 179
1 vote
1 answer
98 views

What's the best way to fix this Drush clear cache bug?

https://issues.civicrm.org/jira/browse/CRM-20292 Hi gang, I'd love to fix the above bug for the core. Does anyone know the best way to solve it, or where I should begin to look for anything that may ...
JohnFF's user avatar
  • 2,343
2 votes
1 answer
97 views

Drush cannot disable civicrm debug

The drush command drush civicrm-disable-debug returns error The drush command 'civicrm-disable-debug' could not be found. Run 'drush cache-clear drush' to clear the commandfile cache if you have ...
MarkDQ's user avatar
  • 493
0 votes
1 answer
928 views

Why do I get fatal error, memcached set failed?

Suddenly my dev site is throwing a fatal error whenever I try to use a drush command, even including drush version or drush cc all. I'm on Drupal 7.50 and CiviCRM 4.7.15, Drush 7.0.0 and I am unaware ...
Christia's user avatar
  • 2,457
2 votes
2 answers
175 views

passing JSON objects to drush cvapi

I'm building API extension that takes complex objects as parameters. The API exporer does a brilliant job at parsing the objects, but drush less so. Commands I am trying are: `drush @contact cvapi ...
ErichBSchulz's user avatar
  • 1,571
1 vote
1 answer
204 views

Syntax for drush command civicrm-sql-dump

My attempt to backup my civicrm database using mysqldump has failed after a very rocky CiviCRM upgrade process, or it is taking way too long, so I am trying the drush command, drush civicrm-sql-dump ...
Christia's user avatar
  • 2,457
1 vote
2 answers
74 views

Error Backing Up Database using drush: Call to undefined function drush_sql_dump_execute()

I am running Drupal 7.37 and CiviCRM 4.3.8. I am in the process of upgrading both, but currently get an error when manually creating a backup of the CiviCRM database. All regularly occurring daily ...
Christia's user avatar
  • 2,457
7 votes
1 answer
166 views

What's the optimal way to install and track CiviCRM with Drupal and git?

First, I know compatibility with Drupal 8 is not full yet. There are still open bugs, a bunch of open PRs and an apparent lack of code review. But let's ignore that for a moment and consider civi d8-...
lynxlynxlynx's user avatar
0 votes
1 answer
134 views

Funky errors in 'drush cvup' / 'drush cvupdb'

I'm trying to upgrade from CiviCRM 4.7.4 to 4.7.9 for its security update. I'm doing this using 'drush' on my dev site. It seems to be hitting a couple different problems. Here's the first step: % ...
Ken Williams's user avatar
6 votes
1 answer
113 views

Is command-line upgrade broken on CiviCRM 4.7.7?

I just tried upgrading a very vanilla site from 4.7.6 to 4.7.7. I ran drush civicrm-upgrade-db, which has worked previously on this site (which receives every point update - it's our internal CRM ...
Jon G - Megaphone Tech's user avatar
4 votes
1 answer
250 views

Can I chain API calls through drush?

API chaining works well in Javascript and PHP. For example, I can retrieve a contact's email addresses using this code generated by the API Explorer: Php $result = civicrm_api3('Contact', 'getsingle'...
Noah Miller's user avatar
  • 1,057
3 votes
2 answers
62 views

Drush failing to build database during new installation

I am building a Docker container for CiviCRM, it is 99.9% done. Unfortunately, when I try to install the actual module via Drush, it spits out an error. I am fairly certain this isn't a Docker related ...
Salt's user avatar
  • 103
4 votes
1 answer
212 views

Install CiviCRM without installing the database. And install the database without installing CiviCRM

What madness is this? Sorry for the daft title. Let me explain. I'm trying to create a docker image for CiviCRM which separates out the web server, database server, and program data itself. In theory,...
DMCoding's user avatar
  • 361
8 votes
4 answers
4k views

DB Error: unknown error

I'm trying to do some site development on my dev copy of the site, but I'm seeing the following error, both in the browser and in drush commands like drush cc all: Sorry but we are not able to ...
Ken Williams's user avatar
1 vote
3 answers
326 views

drush requires civicrm to be enabled when installing in saltstack

I am trying to use saltstack to provision a centos 6.7 system that has drupal and civicrm. I have civicrm as a tar ball that I extract into sites/all/modules before trying to install. I am able to do ...
njvb's user avatar
  • 141
1 vote
1 answer
259 views

Autoloader problem after upgrade to version 4.6.8

I'm not quite sure if this is a drush or a civicrm problem, sorry if this is the wrong forum. I did an upgrade yesterday evening from version 4.6.4 to version 4.6.8. Drush version is 5.9. Today I ...
Vandalf's user avatar
  • 43
15 votes
5 answers
3k views

Is it easy to upgrade CiviCRM using drush?

The standard upgrade process for CiviCRM is quite a complex process according to the instructions in the wiki. Is it easier to use drush to upgrade CiviCRM? If so, how do you do this? I couldn't ...
William Mortada's user avatar
4 votes
2 answers
472 views

drush civicrm-sql-dump dumps the drupal database - how do I get it to dump the civicrm database?

I've recently made some backup scripts to automate backup of my site and databases. One of the scripts uses drush to dump the drupal and civicrm databases with these commands: drush @myserveralias cc ...
Anders Iversen's user avatar
4 votes
4 answers
1k views

CiviCRM does not have permission to write temp files

Two users are trying to access the temp files (where, for instance, the compiled templates are stored): www-data (when it's accessed from the website) and the sysadmin that run drush commands By ...
Xavier's user avatar
  • 10.2k
2 votes
1 answer
265 views

Drush error: "Command ... needs the following module(s) enabled to run: civicrm"

I am trying to use Drush to run a CiviCRM command (for example, civicrm-sql-dump and although CiviCRM is enabled and running fine, I get the following type of error: > drush civicrm-sql-dump > ...
Laryn's user avatar
  • 8,231