Hot answers tagged

17 votes
Accepted

Is it easy to upgrade CiviCRM using drush?

To answer my own question, it is possible to update CiviCRM with drush but this isn't completely straightforward either. For the benefit of others I post the steps I took below. These steps must be ...
9 votes

Is it easy to upgrade CiviCRM using drush?

You can get a list of Civi-related Drush commands simply by typing drush on the command line. Excerpt: All commands in civicrm: (civicrm) civicrm-api (cvapi) CLI access to CiviCRM APIs. It ...
7 votes

passing JSON objects to drush cvapi

Here is how to pass an array to drush echo '{"retrieval_parameters":{"jobId":97727336,"filePath":"Raw Recipient Data Export May 15 2017 22-07-43 PM 674.zip"}}' | drush cvapi Omnirecipients.get --in=...
  • 1,021
7 votes
Accepted

Can I chain API calls through drush?

Drush can read parameters from standard input in JSON format if you supply the argument --in=json. This is what we need for API chaining, because chaining uses nested parameters, and in contrast to a ...
  • 1,012
7 votes
Accepted

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

For some reason the Drush cache is not up to date (for example, if you've recently upgraded CiviCRM). If you clear the Drush cache as follows, the command should work as expected: > drush cc drush
6 votes
Accepted

DB Error: unknown error

Reviewing the stack trace you provided, the line [debug_info] => SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._', 3 ) [nativecode=3057 ** Incorrect user-...
  • 2,455
5 votes

CiviCRM does not have permission to write temp files

There's no single perfect solution to this, but there are several adequate solutions. To highlight some trade-offs among the approaches raised so far: For each security principal, use separate data-...
  • 5,599
5 votes

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

Issue causing this: Extensions. In PHP logs I found out Symphony was mentioned along with Flexmailer. We had alpha outdated version of Flexmailer causing issues. Disabling it/ updating it seems to ...
4 votes

DB Error: unknown error

Browser - From the browser, go to Administer > System Settings > Debugging and Error Handling and you can turn on Enable Debugging and Display Backtrace. That should provide you with more specific ...
4 votes
Accepted

Is command-line upgrade broken on CiviCRM 4.7.7?

Someone actually provided the answer to another person on the CiviCRM chat channel, so I'm posting it here: <juri_> "You have requested a non-existent service 'sql_triggers'." <juri_> ...
4 votes
Accepted

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

The cv upgrade:db command from https://github.com/civicrm/cv/pull/2 was recently merged for v0.2.3. This revision hasn't been broadly deployed or tested yet, but it provides a richer upgrade ...
  • 5,599
3 votes
Accepted

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

I ran into a similar problem when manually updating. Depending on how your database is configured the update will fail when trying to change the image_URL from VARCHAR(256) to VARCHAR(512). I wasn't ...
  • 1,146
3 votes

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

One answer to your question is that you can use the sql-dump drush command to dump your civicrm database by using this option: --database : The DB connection key if using multiple connections in ...
  • 6,123
3 votes
Accepted

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

From the excellent interactive documentation here -- https://buildkit.civicrm.org/#/tutorials (which is almost impossible to find unless you know where to look): ## Download application (with ...
  • 351
3 votes

drush requires civicrm to be enabled when installing in saltstack

Turns out that when running in saltstack drush can't resolve the right environment variables to find ~/.drush. I put civicrm.drush.inc in my drush/commands directory and it fixed the problem.
  • 141
3 votes

CiviCRM does not have permission to write temp files

Setting directories group-setuid might get you part of the way (with chmod g+ws templates_c), but maybe we should consider something like this in the CiviCRM drush module?: $config = CRM_Core_Config::...
  • 3,171
3 votes
Accepted

Drush cannot disable civicrm debug

The civicrm-disable-debug command isn't defined in civicrm_drush_command(). See line 155: $items['civicrm-enable-debug'] = array( 'description' => "Enable CiviCRM Debugging.", ); To solve this ...
3 votes

Drush sql-sync and civicrm issue

Civicrm utilises sql triggers for a number of purposes - including but not limited to populating values into the log_civicrm_% tables - if you have logging turned on under Admin -> System Settings -> ...
  • 1,695
3 votes
Accepted

Drush sql-sync and civicrm issue

In stead of using drush for this, I use the "mysqldump --skip-triggers"command exactly for that reason: mysqldump --skip-triggers -u db_user -pdb_password db > export.sql
3 votes

Cron job has started producing output

Not sure why it's suddenly started producing output when it didn't previously, but you could use: #!/bin/sh a=`drush -r /home/crwheelmen/www/www --quiet civicrm-api job.execute` if echo $a | grep -qv ...
  • 11.3k
3 votes

Civi 5.x not recognizing PHP 7.1 in Drush

That sounds like your command line version of php is different to the one being used by your webserver. See eg https://drupal.stackexchange.com/questions/44967/the-php-version-is-not-correctly-...
  • 11.3k
3 votes
Accepted

How do I access drush commands specific to CiviCRM?

The readme for cv needs updating. It's now tested pretty well with drupal 8. I would use cv instead. See also https://lab.civicrm.org/dev/drupal/-/issues/76
  • 18.8k
2 votes

CiviCRM does not have permission to write temp files

Our solution to mixed access to CiviCRM's cache files (and other situations where permissions issues arose) has been a daemon which monitors filesystem entries and "corrects" permissions immediately ...
2 votes

CiviCRM does not have permission to write temp files

Tim describes a solution based on linux ACL: https://github.com/totten/amp/blob/master/doc/perm.md But it requires amp, that I (might be wrongly) see a dev only tool. Does someone use something like ...
  • 10.1k
2 votes

Is it easy to upgrade CiviCRM using drush?

I use the following for Drupal 7 which I find a straightforward process: (I do this on a development copy of the site first to check for issues) cd public_html/sites/all/modules // go to modules ...
  • 882
2 votes

Is it easy to upgrade CiviCRM using drush?

another helpful thing that I do when using drush for civi upgrades: since drush does not give you any information about where in the process the upgrade is (the GUI has the progress bar that says what ...
  • 590
2 votes

drush requires civicrm to be enabled when installing in saltstack

I've seen this behaviour occasionally on CiviCRM sites where CiviCRM is already installed, and it frequently clears up by use of drush cc drush or drush rr (registry-rebuild). If you're installing ...
2 votes

DB Error: unknown error

Sorry for the late post here, but this tip might help someone going forward with this error. I too was receiving this error on a fresh install of CiviCRM with WordPress. It was noted there were ajax ...
  • 301
2 votes

Drush failing to build database during new installation

This error can happen if you attempt to load a CiviCRM DB over the top of an existing DB. It's possible that's what you're running into here. Looks like there are two files in the CiviCRM ...
2 votes
Accepted

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

I would bet almost 100% that you're using drush 7 or higher. The function drush_sql_dump_execute doesn't exist in drush 7. Support for drush 7 was added as of CiviCRM 4.5.5 - see CRM-15567. That ...

Only top scored, non community-wiki answers of a minimum length are eligible