CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • CiviCRM/Pantheon/Drupal/MySQL Installation
Pages: [1]

Author Topic: CiviCRM/Pantheon/Drupal/MySQL Installation  (Read 5478 times)

j0sh1314

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.3.7
  • CMS version: Drupal 7
  • MySQL version: 5.5.29
  • PHP version: unsure
CiviCRM/Pantheon/Drupal/MySQL Installation
October 14, 2013, 08:03:32 pm
Hi All,

IM trying to install CiviCRM on my dev site and I was following the directions on CiviCRM website on how to install. Because Pantheon uses a newer version of MySQL, they say I should add the following code to MySQL:

-- Assuming a database called "civicrm" and a user called "civicrm_user"
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, TRIGGER, CREATE ROUTINE, ALTER ROUTINE ON civicrm.* TO 'civicrm_user'@'localhost' IDENTIFIED BY 'realpasswordhere';

Now I am a newbie, so I connected to MySQL and ran the code changing local host to the host pantheon gave me and put in the password pantheon assigned me. But it doesnt work. I also changed civicrm.* to pantheon.* because I know pantheon doesnt allow you to have more than one database. I also tried changing user name from civicrm_user to pantheon to try that. I keep getting this error though:

Error Code 1044: Access denied for user 'pantheon'@'%' to database 'pantheon'

Any help for a newbie??  ???

Thanks

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: CiviCRM/Pantheon/Drupal/MySQL Installation
October 14, 2013, 10:36:14 pm
Hi Josh

It sounds like you might not have the right MySQL user there - make sure you've got the right user, password and DB.

Pantheon probably doesn't let you grant rights to yourself, but you should be able to check if you have the rights you need all the same.

https://dev.mysql.com/doc/refman/5.0/en/show-grants.html

Code: [Select]
mysql> SHOW GRANTS;
+---------------------------------------------------------------------------------------------------------------+
| Grants for user@localhost                                                                                     |
+---------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'user'@'localhost' IDENTIFIED BY PASSWORD '*AAAABBBBCCCCDDDDEEEE00001111222233334444'   |
| GRANT ALL PRIVILEGES ON `db1`.* TO 'user'@'localhost'                                                         |
| GRANT ALL PRIVILEGES ON `db2`.* TO 'user'@'localhost'                                                         |
| GRANT ALL PRIVILEGES ON `db3`.* TO 'user'@'localhost'                                                         |
+---------------------------------------------------------------------------------------------------------------+
4 rows in set (0.09 sec)

ALL PRIVILEGES should do the trick (it translates to "everything but the ability to GRANT further privileges").

If you see a list of privileges, check the privileges match what's required for your app.

(question also posted at http://help.getpantheon.com/pantheon/topics/civicrm_install_and_mysql_question for anyone else interested in Pantheon)
« Last Edit: October 14, 2013, 10:40:17 pm by Chris Burgess »
@xurizaemon ● www.fuzion.co.nz

kreynen

  • I post occasionally
  • **
  • Posts: 105
  • Karma: 8
Re: CiviCRM/Pantheon/Drupal/MySQL Installation
October 15, 2013, 07:10:14 am
Pantheon is different than most hosts.  As @ j0sh1314 pointed out, because of the integrated dev -> test -> live workflow, you cannot simply create additional databases or grant additional users access to the databases.   Each environment uses a different MySQL user to connect to a different database.  That everything you need to connect to MySQL, Git, and/or SFTP is available in under the Connection Information button in the Pantheon Dashboard.  Clicking on that button while in the dev environment will show the dev connection info, test will shows test, etc. 

To get CiviCRM to run on Pantheon, you must add the civicrm_ tables to the same database as the Drupal tables.  This may annoy many sysadmin types, but it's the trade off for having a low cost, web controlled staging workflow. 

Unfortunately, understanding how Pantheon's databases are configured isn't enough to get CiviCRM running.  If you look at the Drupal setting.php file, you'll notice that the same file is used in all the environments using variables instead of hard coded connection information...

http://helpdesk.getpantheon.com/customer/portal/articles/708588-working-with-settings-php

You have to do the same thing for the civicrm.settings.php file.

https://drupal.org/project/civicrm_starterkit includes patches to that the civicrm.settings.php includes the necessary Pantheon specific configuration information when CiviCRM is installed https://dashboard.getpantheon.com/products/civicrm_starterkit/spinup.  We're also patching the way sessions are managed during the install and taking advantage the fact that user the web server is running as can write to /sites/default/ during the initial configuration.  After the install, the files in /sites/default/ are read only.  The web server can only write to /sites/default/files.

The Pantheon specific patches are clearly labeled in the .make http://drupalcode.org/project/civicrm_starterkit.git/blob/refs/heads/7.x-4.x:/drupal-org.make#l25

Unfortunately, while it is possible to switch between install profiles/distributions using a module like https://drupal.org/project/profile_switcher or manually adjusting variables and database settings, that won't change where your Pantheon site is looking for upstream updates so you won't be able to take advantage of one click installs of CiviCRM updates

http://helpdesk.getpantheon.com/customer/portal/articles/1150064-running-a-custom-distribution-on-pantheon

The CiviCRM Start Kit includes several Drupal modules that make is easier to run CiviCRM on Pantheon including https://drupal.org/project/civicrm_cron and https://drupal.org/project/civicrm_clear_all_caches.

So while you can do it on your own, it's a heck of a lot easier if you switch from an the standard D7 upstream drop to the CiviCRM Start Kit. 

I'd be glad to barter my time helping you make that switch with your time improving the CiviCRM Starter Kit documentation.


Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: CiviCRM/Pantheon/Drupal/MySQL Installation
October 15, 2013, 09:49:43 am
Thanks Kevin - we have a customer who are looking towards Pantheon at the moment and I'm looking forward to seeing it in action (again, with CiviCRM this time).

Would love to hear more about the highs and lows of CiviCRM on that platform - obviously it's not been trivial to get it working there, so you must have had good reason to commit to making that work?

I see there was a CiviCon presentation on this (and a blog post) - don't suppose the session was recorded and published? (Apparently not? Archive.org, Vimeo, SF2013 site.)
« Last Edit: October 15, 2013, 09:56:12 am by Chris Burgess »
@xurizaemon ● www.fuzion.co.nz

j0sh1314

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.3.7
  • CMS version: Drupal 7
  • MySQL version: 5.5.29
  • PHP version: unsure
Re: CiviCRM/Pantheon/Drupal/MySQL Installation
October 15, 2013, 10:23:29 am
Thanks Chris and Keynen!

Kreynen, so you think it would be easier to migrate my site to the CiviCRM starter kit than to patch it? If so (or either way), Id love your help and would be willing to help with the documentation for this with the knowledge that I am quite a novice at all this, but I will do my best.

Let me know if that works!

Thanks
Josh

kreynen

  • I post occasionally
  • **
  • Posts: 105
  • Karma: 8
Re: CiviCRM/Pantheon/Drupal/MySQL Installation
October 16, 2013, 05:02:09 am
@j0sh1314 we need new users to translate geek-speak into human readable support!  Shoot an email to kevin at alittlehelphosting.com and we can get started .

The problem with patching is that you'd need to do that for every release of CiviCRM.  If you switch to the CiviCRM Starter Kit, that work is done within a few days of each CiviCRM release and tested on dozens of sites before you even see the update on Pantheon.  That's not to say we never make a mistake in the packaging, but because you're using the same base configuration as hundreds of other sites on the same hosting framework, you know that any issue will resolved quickly.  The hope is that the dev -> test -> live workflow increase amount of human testing for each release of both CiviCRM in general and CiviCRM on Pantheon specifically.

We're maintaining the CiviCRM Starter Kit and Community Media Starter Kit as a service to our A Little Help Hosting clients, but sharing everything we do openly so that anyone who wants to use the same code base can.  I've also been doing presentation about building use case specific Drupal distributions that include CiviCRM like https://drupal.org/project/cm_starterkit_moderate, but instead of Community Media customize the modules and CiviCRM extensions included for churches, mountain biking, etc.

@Chris Burgess the biggest challenges to running CiviCRM on Pantheon is the caching of static file paths by CiviCRM.  Issues like https://drupal.org/node/2096467 and https://drupal.org/node/2107575 are very specific to running in an environment with multiple PHP "worker servers" and load balancing.  We continue to improve the CiviCRM integration on Pantheon w/ modules like https://drupal.org/project/civicrm_clear_all_caches.  With that module enabled, clicking the Clear Caches button on Pantheon will clear both Drupal and CiviCRM's caches.


kreynen

  • I post occasionally
  • **
  • Posts: 105
  • Karma: 8
Re: CiviCRM/Pantheon/Drupal/MySQL Installation
October 18, 2013, 06:26:17 am
Unfortunately changing the upstream source of a Pantheon site is actually much more complicated than I thought.  I thought this would be as easy as...

Code: [Select]
git remote set-url origin http://github.com/kreynen/civicrm-starterkit-drops-7
But you can't change that in the git repo for the dev environment... only on your local clone.  I asked Pantheon about changing that...

http://help.getpantheon.com/pantheon/topics/is_it_possible_to_change_the_upstream_distribution_an_existing_install_is_using

Their response is that while you could add profiles/civicrm_starterkit to the profiles on your site and merge it into the updates coming from the D7 Standard upstream, you wouldn't be able to apply CiviCRM updates this way.  So the process involves starting a new site on Pantheon and would look something like...

  • Start a new CiviCRM Starter Kit site on Pantheon
  • Download the code, files, and database Backups from the existing site
  • Using Git or SFTP, upload your modules, themes, and libraries to sites/all/modules
  • Upload the database and files to the new site using the Workflow import option. When you replace the initial install database, Drupal will forget about modules in /profiles/civicrm_starterkit including CiviCRM.  Only modules from an active profile even show up in the admin/modules/list to be enabled.  The standard Drupal profile doesn't include any modules in the profile (the are in the core /modules).  The Standard profile simply enables more modules by default than the Minimal profile.
  • At this point your site should look the way it did on the original Pantheon instance
  • Add https://drupal.org/project/profile_switcher to your sites/all/modules and enable.  This module is included in the CiviCRM Starter Kit, but (again) until you enable that profile, the module won't show up in admin > modules > list
  • Switch the profile to civicrm_starterkit using Admin > Configuration > Development > Profile Switcher
  • Once the CiviCRM Starter Kit profile is enabled, the list of modules will include the modules in the profiles/civicrm_starterkit/moderate.  Enable and configure CiviCRM the same way you normally on any other install

Because the install is using the version of CiviCRM from the Starter Kit, it CiviCRM will be aware that it is being installed on Pantheon and adjust the settings to your civicrm.settings.php file appropriately. 

If you want to remove modules from your sites/all/modules directory that may be overriding the same module that's now being maintained as part of the distribution, you can use https://drupal.org/project/profile_status_check to find those modules.  When you remove them from your sites/all/modules, Drupal will use the version in profiles/civicrm_starterkit/modules.   

JF

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.4.4
  • CMS version: Joomla 3.2.3
  • MySQL version: 5.5.32
  • PHP version: 5.3.28
Re: CiviCRM/Pantheon/Drupal/MySQL Installation
May 22, 2014, 02:12:56 pm
Hi Kreynen,

I followed your instructions and all went well until the very last step. When I try to enable CiviCRM I get an error message:

Initialization Error

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => simpleHandler
            )

       
Code: [Select]
=> -18
    [message] => DB Error: no such table
    [mode] => 16
    [debug_info] => SELECT *,  config_backend 
 FROM civicrm_domain
 
 WHERE (  civicrm_domain.id = 1 ) 
 
 
 
 [nativecode=1146 ** Table 'pantheon.civicrm_domain' doesn't exist]
    [type] => DB_Error
    [user_info] => SELECT *,  config_backend 
 FROM civicrm_domain
 
 WHERE (  civicrm_domain.id = 1 ) 
 
 
 
 [nativecode=1146 ** Table 'pantheon.civicrm_domain' doesn't exist]
    [to_string] => [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info="SELECT *,  config_backend 
 FROM civicrm_domain
 
 WHERE (  civicrm_domain.id = 1 ) 
 
 
 
 [nativecode=1146 ** Table 'pantheon.civicrm_domain' doesn't exist]"]


Any ideas how to get Civi working on this site?
Thanks!

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: CiviCRM/Pantheon/Drupal/MySQL Installation
May 22, 2014, 02:42:51 pm
JF, that error is telling you that the database CiviCRM is configured to use does not have a 'civicrm_domain' table.

This might indicate that the CiviCRM schema is not loaded, OR that the wrong database has been addressed in CIVICRM_DSN in your civicrm.settings.php?
@xurizaemon ● www.fuzion.co.nz

JF

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.4.4
  • CMS version: Joomla 3.2.3
  • MySQL version: 5.5.32
  • PHP version: 5.3.28
Re: CiviCRM/Pantheon/Drupal/MySQL Installation
May 22, 2014, 02:58:51 pm
Thanks Chris.
Is this because step 4 in kreynen's instructions I essentially overwrite the original database (that includes civi tables) with a new database (from a site that does not have civi installed)?

Can I update my civicrm.settings.php file to point to the correct database?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • CiviCRM/Pantheon/Drupal/MySQL Installation

This forum was archived on 2017-11-26.