CiviCRM defines MySQL triggers for certain tasks. When you use phpMyAdmin, mysqldump or similar to export your database to a text file, it exports your triggers as well. The format is something like this:
/*!50003 CREATE*/ /*!50017 DEFINER=`newpress`@`localhost`*/ /*!50003 TRIGGER civicrm_address_after_insert after insert ON civicrm_address FOR EACH ROW ...
If you have installed civicrm-buildkit and configured civibuild, then you can use the tutorial steps at Daily Coding: Upgrade Tests.
If you don't use civibuild, then you can piece-together a similar workflow using civicrm-upgrade-test.
For more discussion about writing upgrade logic, see Upgrade Reference on the wiki.
For a general, high-level overview of ...
You should use the API as the data dictionary. The API explorer (available in every installation) provides a convenient interface to browse the data dictionary.
The demo sites each have an API explorer and they are the authoritative public data dictionary for CiviCRM. For example http://dmaster.demo.civicrm.org/civicrm/api/explorer (login first with ...
This is doable using the API, and I've accomplished it using Pentaho Kettle. It has a CiviCRM Input and CiviCRM Output step, which use the REST API. You're right to be concerned about the SQL-based approach, since there's been discussion of deprecating that table in favor of a line item-based approach to connecting contributions and memberships.
If you ...
Saw the same issue here.
We noticed that the field appeared twice in the list of fields. We'd selected it as CiviCRM Contact: My Field - but it also appeared as CiviCRM Custom: My Field.
When we selected it as CiviCRM Custom: My Field, it worked.
It sounds like you imported the first_name and last_name values - but the value at the top of the record is the display_name. You have two options:
Use your SQL script to update the display_name accordingly.
Export ONLY the contact_id of the affected records (or all records). Reimport the contact ID via the "Import Contacts" functionality. All records ...
The easiest would be if you can find it in the CiviCRM custom groups? Using Administer/Customize Data and Screens/Custom Fields. If that does not work, check the table civicrm_custom_group. You will probably see an entry there with the column name 'is_reserved' having the value 1.
If that is the case, change the value for 'is_reserved' to 0 and check if you ...
The developer documents on the CiviCRM Wiki are very extensive and cover the codebase and development standards and best practices. There are reference sheets digging into specific areas for the project at hand.
There are XML files on GitHub that describe the database structure and fields.
Your CiviCRM instance should also have an API explorer and ...
I just ran into this issue (on current Drupal, current CiviCRM setup) and confirmed that the way it's set now, a non-admin user needs the permission "access deleted contacts" to run this report.
Hope that's helpful - not much of an answer but I lost access to my old account and don't have enough rep to post a comment :)
it seems php 7.2 is not compatible with 5.x.x
or i do not know how to do the configuration
i think downgrade the php would be the best solution
but i wonder if there is other answer, and how to do it....
-downgrade php does not help, same error appears
-downgrade mysql to 5.5 works!
Jon G's answer is correct.
However, If you're not in the world of shell editors and perl, you can also open the dump file in a text editor (not a word processor) and do a search and replace. You can just search for DEFINER=namename@localhost portion, replace it with nothing, and leave the rest of the line in place.
Generally, it is wisest to always use the API. Many necessary updates actually touch multiple tables and the API takes care of it nicely. This is especially true with financial updates. The API also encapsulates the database structure so as to effectively hide any database structure changes that may happen over time.
IMHO, pretty much the only time that ...
If drupal and civicrm are sharing a database, then this will work without any further configuration. But if you have civicrm in a separate database, there is an extra step:
Every time you create a custom field in CiviCRM it adds a new table to the database. You have to tell Views about the new table by adding the new line to your settings.php file.
You should be able to use the functions in:
to do symmetric encryption/decryption of the fields. Password related fields in the CiviCRM db are encrypted. As Lesley mentions, there are two aspects to this problem. Encrypting data, and restricting access to the data to a certain class of users
You can add this to the top of your .sql file, then try loading it again.
SET FOREIGN_KEY_CHECKS = 0;
This will permit MySQL to load the data while ignoring the foreign key checks.
Since CiviCRM uses foreign key checks, this is a good idea only if the checks throw errors when loading the DB but not when using CiviCRM afterwards.
Alternatively, to ensure ...
I've not used them but have happened on this previously, I believe it's a GUI for the API which allows importing into any entity. Would likely still be a two stage process though, as you'd need the IDs from the first pass
Carlos Capote for Amnesty International Spain has been doing work to facilitate imports and exports using Pentaho Kettle. See https://civicrm.org/blogs/capo/new-tool-civicrm-data-integration for background and various improvements being done in Fall 2014 (http://wiki.civicrm.org/confluence/display/CRM/Civi+Data+Integration+v1.2).
Code is available at https:...
We commissioned a developer to implement a fairly complex migration extension for a project a while back. The whole thing is very much coupled to our system however you might be able to glean something from their repo.
They didn't handle payments in this migration, we actually added that after the fact. In our case, we were only concerned with importing ...
We were recently asked to 'Encrypt one CiviCRM custom field' for one of our clients who uses Webform CiviCRM module as a GUI to view/edit/add custom field values to CiviCRM for their clients.
I ended up leveraging Drupal Encrypt module to not just encrypt the values stored on the Drupal side (in the Webform Submission) but also to encrypt the values stored ...
Do you want just one field encrypted or a group of fields (if you're dealing w/HIPAA data, probably it is more than one, right?) Create custom fields where the 'Type' is, say, 'HIPAA' (you can create this subtype by subtyping your basic object, whether it is Activities, Campaigns, or Contacts). From there, you'd need to add a hook/code to encrypt fields ...
The simplest route I believe is to generate DB dumps which omit these triggers by using mysqldump's --skip-triggers switch
mysqldump --skip-triggers NAMEOFDB > NAMEOFDB.sql
This outputs a version of the DB dump without triggers, which CiviCRM will regenerate once loaded onto the next site.
If you're using another interface to mysqldump, eg phpmyadmin ...
Yes, there is such a function; but you shouldn't use it.
Make each query separately and check the result.
Avoid functions which make multiple SQL queries in one action, as they make it harder for your application logic to handle unexpected cases.
CRM_Core_DAO::executeQuery() executes a single query against the DB - use this.
Agree, the API is decidedly the best way as it does multiple stuff and should continue to function over upgrades when there are database changes. I only use SQL when either the API does not do what I need, with custom data because it is easier most of the times or when doing bulk stuff.
This particular error seems to be a recent regression in 4.7.23:
You can wait until the release of 4.7.24 or apply the patch from https://github.com/civicrm/civicrm-core/pull/10819 manually.
You might be running the manual query under a different mysql user than the one that owns the function, so you can check who the "definer" is using show create function civicrm_strip_non_numeric;.
If it really is "missing", then you can also manually recreate the function - it's defined in CRM_Contact_BAO_Contact: