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_> ...
Jon G - Megaphone Tech's user avatar
4 votes

CLI Contact Import is not importing address details

The CLI Contact import is meant to work on a per-entity basis, since it uses the API. So Contact is a separate entity from Address. The Contact entity API has a couple of hacks to accept certain ...
Jon G - Megaphone Tech's user avatar
3 votes

How do I import contacts through the command line?

Another option is to use drush in combination with the combination with the cvapi command. For example drush cvapi Contact.create sequential=1 contact_type="Individual" first_name="Ben" middle_name="...
Kainuk - CiviCooP's user avatar
3 votes
Accepted

how to change civicrm settings from command line?

You can use drush cv to update the settings in db. eg drush cvapi Setting.create environment="Production" You can find various options in API explorer to set other settings and see for command in ...
Pradeep Nayak's user avatar
3 votes
Accepted

Running a script from cli

The command cv (https://github.com/civicrm/cv) provides helpers for running PHP code via CLI. For example, to run a single line of PHP code, you might say: cd web-root cv ev 'CRM_Core_I18n_Schema::...
Tim Otten's user avatar
  • 5,684
2 votes

Find Contacts with no Relationships

Lots of years after the question was asked, but still a relevant question. You can find contacts without relationships using the 'without' join in SearchKit: See here
Aidan's user avatar
  • 13.4k
2 votes

Updating an option value with drush cvapi

Looks like a case for API chaining. This or something like it should work: drush cvapi OptionValue.getvalue return=id option_group_id=from_email_address \ api.OptionValue.create={label:'"Fixed" &...
universalhandle's user avatar
2 votes
Accepted

Updating an option value with drush cvapi

In Civi 4.6+, you can use pseudoconstants instead of IDs in many places - including for option_group_id. Civi 4.7 expands the number of places you can use it. So you can get this down to 2 lines by ...
Jon G - Megaphone Tech's user avatar
2 votes
Accepted

CiviCRM reports Cron not running, but my web host is adamant that it is

I think you probably will need to provide full path of php to execute php files. You can try the option from https://stackoverflow.com/questions/19916949/running-php-from-cron-did-not-run-as-cli/...
Pradeep Nayak's user avatar
2 votes

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

For those that use cv is also possible to use: echo '{"enable_components" :["CiviContribute","CiviMember","CiviMail","CiviReport","CiviEvent"] }' | cv api Setting.create --in=json
Kainuk - CiviCooP's user avatar
2 votes
Accepted

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

Thanks to passing JSON objects to drush cvapi I found a solution: echo '{"enable_components" :["CiviContribute","CiviMember","CiviMail","CiviReport","CiviEvent"] }' | drush cvapi Setting.create --in=...
Kainuk - CiviCooP's user avatar
2 votes

cv api job.execute - authentication method unknown

Changed Method to cli-Method. Changed Mysql Auth Method for civicrm Mysql user: https://dcblog.dev/mysql-80-error-the-server-requested-authentication-method-unknown-to-the-client error: The server ...
Mich___'s user avatar
  • 81
2 votes
Accepted

How to explore API from command line?

The graphical api explorer actually fetches all its information about the api from the api. Since the CiviCRM api is available from the command line, you can explore it using the same methods. Fetch ...
Coleman's user avatar
  • 18.5k
1 vote

Error when upgrading civicrm for wordpress with wp-cli

Following up on the comment from Kevin Cristiano above, the WP-CLI commands for upgrade and restore seem to be broken in versions of CiviCRM since the civicrm.settings.php file was moved out of the ...
Christian Wach's user avatar
1 vote

How do I install cv?

I downloaded cv.phar from https://docs.civicrm.org/installation/en/latest/general/cli-cv/ Then I uploaded cv.phar to .../wp-content/plugins/civicrm/civicrm/bin/ Then I was able to do the shell command:...
jimcrist's user avatar
  • 763
1 vote

how to drop all civicrm tables using drush?

I haven't seen anything as clean as drush sql-drop (for drupal) yet, but the following works and is more thorough than the civicrm/sql/civicrm_drop.mysql file: #!/bin/bash # include this in devize.sh ...
alec's user avatar
  • 407
1 vote

how to drop all civicrm tables using drush?

There's a file in the [civicrm root]/sql folder called civicrm_drop.mysql. You should be able to use that as source sql/civicrm_drop.mysql. It doesn't drop views or the canary table, but you can do ...
Demerit's user avatar
  • 22.8k
1 vote

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

There are a few things that can help you out: Most importantly, the API Explorer (Support menu » Developer » API Explorer). It will build your drush command for you through a GUI. You can see there ...
Jon G - Megaphone Tech's user avatar
1 vote

Setting up cron jobs on cPanel

if your user has cron access, you can always create a file, call it cron for simplicity sake, in the file add the command you wish to run, for example mine is a bit interesting cause I have to export ...
BBuchanan's user avatar
1 vote

cron setup failing in new Wordpress installaion

I'm not sure about this but it sounds like a permissions problem and you may need to update the permissions in root/wp-content/plugins/civicrm/civicrm/bin/cli.php to be executable. Hope this solves ...
peterb's user avatar
  • 1,014
1 vote

CiviCRM Wordpress Cron not running - DB Error connect failed

The reference for cli is Manage Scheduled Jobs. It tells This method requires a valid Username and Password (for a Drupal, Joomla or WordPress user who has adequate permissions for the job or jobs ...
Kainuk - CiviCooP's user avatar
1 vote
Accepted

Configuring cron using PHP cli method results in Permission denied

This cron job calls /etc/php.ini as the command, but that file is not an executable (it's the default configuration file for PHP). (The "Permission denied" error is the same as if you asked "run the ...
Chris Burgess's user avatar
1 vote
Accepted

Configuring cron using wp-cli on local server with Mamp Pro

Here's an example wp-cli command I use that works: /home/ubuntu/wp-cli/wp-cli --require=/home/ubuntu/wp-cli/civicrm.php --path=/var/www/wordpress civicrm api job.execute > /dev/null I hope that ...
Jon G - Megaphone Tech's user avatar

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