dev-libre-is/docs/_source/civicrm-libre-is.rst

387 lines
9.9 KiB
ReStructuredText

================
civicrm.libre.is
================
CiviCRM deployment.
`<https://civicrm.libre.is/>`_
Under consideration:
`<https://crm.libre.is/>`_
CiviCRM
=======
CiviCRM is a "constituent relationship management software" for
especially designed for non-profits.
`<https://civicrm.org/>`_
Drupal
======
CiviCRM works with various backends such as Drupal, Joomla, and Wordpress.
Drupal is the most powerful.
`<https://www.drupal.org/>`_
Drupal needs to be installed before CiviCRM.
Install Debian stable (bookworm/12) with Apache and set up Certbot.
Wordpress
=========
The test install will have a CiviCRM with Wordpress install.
`<https://docs.civicrm.org/installation/en/latest/wordpress/>`_
`<https://developer.wordpress.org/advanced-administration/before-install/howto-install/>`_
Download latest release:
`<https://wordpress.org/latest.zip>`_
.. code-block:: sh
sudo apt install unzip python3-certbot-apache php mariadb-server php-mysql
Set up the database.
.. code-block:: sh
sudo mariadb-admin password
mariadb -uroot -p
Then in the database:
.. code-block:: sql
CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE IF NOT EXISTS wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES on wordpress.* to 'wordpress'@'localhost';
FLUSH PRIVILEGES;
EXIT
Import timezone data into the database:
.. code-block:: sh
mariadb-tzinfo-to-sql /usr/share/zoneinfo | mariadb -u root -p mysql
Perhaps change the ownership to your user (in this case jebba)
to install wordpress files. Then unzip wordpress and move to
the best location:
.. code-block:: sh
sudo chown -R jebba:jebba /var/www
cd /var/www/
unzip ~/devel/wordpress/latest.zip
sudo chown -R www-data /var/www/wordpress
Set up apache, perhaps thusly:
.. code-block:: sh
rm /etc/apache2/sites-enabled/000-default*
Edit /etc/apache2/sites-available/wordpress.conf
.. code-block:: apache
<VirtualHost 70.39.82.212:80>
ServerName civicrm.libre.is
ServerAdmin webmaster@localhost
DocumentRoot /var/www/wordpress
ErrorLog ${APACHE_LOG_DIR}/error-civicrm-libre-is.log
CustomLog ${APACHE_LOG_DIR}/access-civicrm-libre-is.log combined
RewriteEngine on
ReWriteCond %{HTTPS} off
RewriteRule ^ https://civicrm.libre.is%{REQUEST_URI} [END,NE,R=permanent]
ReWriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{SERVER_NAME} =civicrm.libre.is
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost 70.39.82.212:443>
ServerName civicrm.libre.is
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/civicrm-libre-is
ErrorLog ${APACHE_LOG_DIR}/error-civicrm-libre-is.log
CustomLog ${APACHE_LOG_DIR}/access-civicrm-libre-is.log combined
RewriteEngine on
ReWriteCond %{HTTPS} off [OR]
ReWriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
ReWriteRule ^(.*)$ https://%1$1 [L,R=301]
ErrorDocument 404 /en/404.html
Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias doc.libre.is
SSLCertificateFile /etc/letsencrypt/live/civicrm.libre.is/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/civicrm.libre.is/privkey.pem
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
.. code-block:: sh
sudo ln -s /etc/apache2/sites-available/wordpress.conf \
/etc/apache2/sites-enabled/
sudo systemctl restart apache2
CiviCRM Install
===============
Once Wordpress is running, install CiviCRM plugins.
Download the Wordpress CiviCRM plugin from here:
`<https://civicrm.org/download>`_
Also install more PHP deps.
.. code-block:: sh
sudo chown -R jebba:jebba /var/www/wordpress/wp-content/plugins/
cd /var/www/wordpress/wp-content/plugins/
unzip ~/devel/civicrm/wordpress/civicrm-5.77.0-wordpress.zip
sudo apt install php-bcmath php-curl php-xml php-zip php-intl \
php-soap php-mbstring php-common php-imagick php-gd
Edit /etc/php/8.2/apache2/php.ini with these values:
.. code-block:: sh
memory_limit = 256M
max_execution_time = 240
max_input_time = 120
post_max_size = 50M
upload_max_filesize = 50M
Then restart apache:
.. code-block:: sh
sudo systemctl restart apache2
Activate the plugin, logging in as Wordpress admin user:
`<https://civicrm.libre.is/wp-admin/plugins.php>`_
Database Backup
===============
HOWTO backup the database. Do this regularly and before major
operations, such as importing contact lists.
Scriptlet to back up all databases on system:
.. code-block:: sh
#!/bin/bash
BACKUPDIR=/var/lib/dbbackup
NOW=`date +%Y%m%d%H%M`
sudo mkdir -p $BACKUPDIR
sudo chown root:root $BACKUPDIR
sudo chmod og-rwx $BACKUPDIR
sudo touch $BACKUPDIR/db-dump-$NOW.sql
sudo chmod 400 $BACKUPDIR/db-dump-$NOW.sql
# Backup full DB
sudo nice mariadb-dump -p --all-databases -uroot --result-file=$BACKUPDIR/db-dump-$NOW.sql
# Compress it
sudo nice xz -9 -T4 -z $BACKUPDIR/db-dump-$NOW.sql
Sciptlet to backup wordpress database, which includes CiviCRM:
.. code-block:: sh
#!/bin/bash
BACKUPDIR=/var/lib/dbbackup
NOW=`date +%Y%m%d%H%M`
sudo mkdir -p $BACKUPDIR
sudo chown root:root $BACKUPDIR
sudo chmod og-rwx $BACKUPDIR
sudo touch $BACKUPDIR/db-wordpress-$NOW.sql
sudo chmod 400 $BACKUPDIR/db-wordpress-$NOW.sql
# Backup full DB
sudo nice mariadb-dump -p -uroot --result-file=$BACKUPDIR/db-wordpress-$NOW.sql wordpress
# Compress it
sudo nice xz -9 -T4 -z $BACKUPDIR/db-wordpress-$NOW.sql
To decompress the file, run a command like this, with "-k", if you
want to keep the compressed version:
.. code-block:: sh
xz -d -k db-wordpress-202409190643.sql.xz
Hubspot Export
==============
Documentation on migrating from Hubspot to CiviCRM.
Data to migrate:
* Contacts.
Contacts Export
---------------
Hubspot can export contacts in these formats, all of which should
export identical data.
* CSV.
* XLS.
* XLSX.
Go to CRM --> Contacts and click the "Export" button on the right side.
For "Customize" export, it has options:
* Include all email addresses.
* Properties options.
* Associations.
Use these options for the most complete export:
* Include all email addresses: Checked.
* All properties and all associations on records: Selected.
* Include all associated record in each association column: Selected.
Click "Export" and it will present a link to an "Import and Export" page,
where it will show the progress of the export.
It will take approximately 1 minute per 1,000 records to export.
The unzipped export will be approximately 2.5 megs per 1,000 records.
The export will have over 500 columns.
Companies Export
----------------
Companies can be exported.
Go to CRM --> Companies and click the "Export" button on the right side.
Use these options for the most complete export:
* File format: CSV
* Include all company domains: Checked.
* All properties and associations on records: Selected.
* Include all association records in each association column.
Deals Export
------------
Go to CRM --> Deals and click the "Export" button on the right side.
* File format: CSV
* Include all company domains: Checked.
* All properties and associations on records: Selected.
* Include all association records in each association column.
Tickets Export
--------------
Go to CRM --> Tickets and click the "Export" button on the right side.
Lists Export
------------
Various mailing lists.
Go to CRM --> Lists and click the "Actions" button on the right side, then
select "Export".
* Name: All lists.
* Format: CSV.
* Choose what you'd like to export: All available list dashboard data.
Inbox Export
------------
HOWTO export?
Calls Export
------------
Go to CRM --> Calls and click the "Export" button on the right side.
* File format: CSV.
* Language of column headers: English.
* All properties and associations on records: Selected.
* Include all association records in each association column.
Tasks Export
------------
Uncheck "Assignee" to view all tasks.
HOWTO export?
Marketing Email
---------------
Go to Marketing --> Email and click the "Export emails" button on the right side.
* Export: Dashboard Emails.
* File Format: CSV.
* Send to: Email address of logged in Hubspot user.
* Columns: All available columns.
* Date: All time.
* Advanced options, Include advanced delivery data: checked.
Note, this export will not appear in the "Import and Export" page, unlike
most other exports.
Marketing Forms
---------------
Go to Marketing --> Forms and click the "Actions" button on the right side, then
select "Export forms".
* Name: All forms.
* Format: CSV.
* Send to: Email address of logged in Hubspot user.
* Choose what you'd like to export: All available form dashboard data.
Marketing CTAs (legacy)
-----------------------
Go to Marketing --> CTAs (legacy) and click "Export Data".
* File format: CSV.
* Send to: Email address of logged in Hubspot user.
Note, this export will not appear in the "Import and Export" page, unlike
most other exports.
Commerce Products
-----------------
Go to Commerce --> Products and click on the "Export" button.
* File format: CSV.
* Language of column headers: English.
* All properties and all associations on records: Selected.
* Include all associated record in each association column: Selected.
Activities Export
-----------------
Activities appear to be emails and such sent to contacts.
These are not in the contacts export.
CiviCRM Import
==============
Importing records, such as from Hubspot.
Contacts Import
---------------
HOWTO import the Hubspot contact export into CiviCRM.
`<https://docs.civicrm.org/user/en/latest/common-workflows/importing-data-into-civicrm/>`_
Before doing an export, definitely make a backup of the database,
in case it doesn't work. Best to do on a test database first,
definitely not in production. :)
Perhaps:
* increase the memory_limit and max_execution_time values in php.ini.