Archive for the ‘CiviCRM’ Category

php reports for civicrm

Tuesday, January 13th, 2015

http://mysqlreports.com/tour.html

http://butleranalytics.com/10-mysql-reporting-tools/

http://www.sqlmaestro.com/video/phpgen_getting_started_controller.swf?autostart=true&showstartscreen=false&showendscreen=false&color=0x1A1A1A,0x1A1A1A

https://www.drupal.org/project/views_aggregator

https://www.drupal.org/node/1918218

https://www.youtube.com/watch?v=-mQ9oj6ThGM

 

http://dev.mysql.com/doc/refman/5.0/en/stored-programs-views.html

 

CiviCRM mysql backups, drupal slaves, and virtual machine backups

Tuesday, January 13th, 2015

Site backup, PHP backup and other

https://www.drupal.org/node/22281

https://github.com/exteon/web3backup

http://wiki.civicrm.org/confluence/display/CRMDOC/Backup+Data

http://www.daniloaz.com/en/using-php-to-backup-mysql-databases/

Drupal slaves

https://www.drupal.org/project/autoslave

http://drupal.stackexchange.com/questions/68564/drupal-master-slave-replication

http://www.extropy.com/forums/knowledge-bases-extropedia/mysql/mysql-replication-drupal

https://www.acquia.com/blog/mysql-ha-architecture-drupal

https://mariadb.com/blog/high-availability-drupal-part-1-investigating-issues

http://en.wikipedia.org/wiki/Multi-master_replication

Mysql backups

http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html

https://www.lullabot.com/blog/article/mysql-backups-using-lvm-snapshots

http://sourceforge.net/projects/automysqlbackup/?source=typ_redirect

http://www.percona.com/doc/percona-xtrabackup/2.2/manual.html

http://www.lenzg.net/mylvmbackup/#Docs

 

Virtual Machine backups

http://vboxtool.sourceforge.net/

https://www.howtoforge.com/virtualbox-creating-backups-and-clones-of-running-virtual-machines-no-downtime-with-lvm-snapshots

http://www.pontikis.net/tip/?id=31

 

civiCase phpMyAdmin set created_date data

Tuesday, January 6th, 2015

In phpMyAdmin, with the civicrm_contacts table, change the created_date type to date (return late and change back to timestamp).

Copy the created_date exported file AA-qryCreatedDate.txt into /home/tech/Downloads

Enter the following into the civicrm_contacts sql section

CREATE TEMPORARY TABLE civicrm_contact_temp LIKE civicrm_contact;
LOAD DATA INFILE '/home/tech/Downloads/AA-qryCreatedDate.txt'
INTO TABLE civicrm_contact_temp
FIELDS TERMINATED BY ','
(id, created_date);
UPDATE civicrm_contact
INNER JOIN civicrm_contact_temp on civicrm_contact_temp.id = civicrm_contact.id
SET civicrm_contact.created_date = civicrm_contact_temp.created_date;

DROP TEMPORARY TABLE civicrm_contact_temp;

change the created_date type back to timestamp.

civicrm_note import

Use a pipe to delimit and don’t use “s for text.

/home/tech/Downloads/AA-qryNotesContacts2.txt

load data infile ‘/home/tech/Downloads/AA-qryNotesContacts2.txt’ into table civicrm_note fields terminated by ‘|’ enclosed by ” lines terminated by ‘\n’ (entity_table,entity_id,note,modified_date,Subject,privacy);

civiCRM import

Monday, January 5th, 2015

https://civicrm.org/extensions/api-csv-import-gui/11

add gnome-commander so permissions can be set recursively

create extensions folder in /var/www/drupal/sites/all/modules/contrib/extentsions

add extensions path to civiCRM
http://localhost/index.php?q=civicrm/admin/setting/path&reset=1&civicrmDestination=%2Findex.php%3Fq%3Dcivicrm%2Fadmin%2Fextensions%26amp%3Breset%3D1

also here

http://localhost/index.php?q=civicrm/admin/setting/url&reset=1&civicrmDestination=%2Findex.php%3Fq%3Dcivicrm%2Fadmin%2Fextensions%26amp%3Breset%3D1

download extension and decompress it into the extensions folder

use gnome-commander to set extensions folder recursive permissions for www-data (note: commaander/file/open as root)

 once open

File/start … as root

use up arrow until at root then /var/www/drupal/sites/all/modules

highlight /contrib

File/change permissions

Apply recursively for all files

Back at the extensions page click the refresh button and the new extension should show up.

Install the new extension

The civiCRM menu will have a link at the far right, but it won’t work.

Open as admin > /var/www/drupal/sites/all/modules/contrib/extensions/nz.co.fuzion.csvimport-1.1/csvimport.php

Find ‘url’ => ‘csvimporter/import’,

change to add civicrm/

           ‘url’ => ‘civicrm/csvimporter/import’,

Save and done

civiCase civiCRM php command line for apis

Tuesday, December 23rd, 2014

The basics

https://civicrm.org/blogs/xavier/api_batch_tools

Here are the new usage directions for 4.2:

 * Usage:
* php bin/csv/import.php -e <entity> –file /path/to/csv/file [ -s site.org ]
* e.g.: php bin/csv/import.php -e Contact –file /tmp/import.csv

 * Usage:
* php bin/csv/export.php -e <entity> [ –field=value –field=value ] [ -s site.org ]
* e.g.: php bin/csv/export.php -e Contact –email=jamie@progressivetech.org -s mygroup.org

 

 

Step one: Open myPHP and export fields for groups

Setp two: Create csv of new values with relevant fields in first row (use comma separated values)

Step three: run import.php with relevant csv file

as super user

php /var/www/drupal/sites/all/modules/contrib/civicrm/bin/cli.php -e contact -a get --output --id=2

 

http://localhost/?q=civicrm/api/doc

 

http://localhost/?q=civicrm/api/explorer