Answers.Body: <p>Sounds like you also need to update the settings inside your file that points to your Joomla database. I don't know exactly where that is, as I use Drupal. But mine is at /home/username/public_html/sites/default/settings.php. That is where I tell Drupal how to connect to its database. Every CMS I've ever worked with has something similar. Inside that file is a listing of CiviCRM database tables so that your CMS can connect. If you haven't changed it there, then Joomla is still looking for the old database.</p>
  
  <p>Edit:</p>
  
  <p>The lines you're editing in your CMS's settings file would look similar to this below. Unfortunately it doesn't get formatted right when pasting in here, so I've only included the first dozen lines or so.</p>
  
  <pre><code>$databases['default']['default']['prefix']= array(
    'default' =&gt; '',
    'civicrm_acl'                              =&gt; '`username_civicrm`.',
    'civicrm_acl_cache'                        =&gt; '`username_civicrm`.',
    'civicrm_acl_contact_cache'                =&gt; '`username_civicrm`.',
    'civicrm_acl_entity_role'                  =&gt; '`username_civicrm`.',
    'civicrm_action_log'                       =&gt; '`username_civicrm`.',
    'civicrm_action_mapping'                   =&gt; '`username_civicrm`.',
    'civicrm_action_schedule'                  =&gt; '`username_civicrm`.',
    'civicrm_activity'                         =&gt; '`username_civicrm`.',
    'civicrm_activity_contact'                 =&gt; '`username_civicrm`.',
    'civicrm_address'                          =&gt; '`username_civicrm`.',
    'civicrm_address_format'                   =&gt; '`username_civicrm`.',
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-18T15:51:21.483Z
Answers.Text: I don't think that's it. I did change the CMS settings.php to point to the dev database, and that is the database that the CiviEvent Listing module is trying to connect to. And, the dev site and other parts of Civi in the dev environment are all functioning normally.
Answers.UserDisplayName: Phil Morice Brubaker
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-19T00:11:22.813Z
Answers.Text: So you changed a bunch of lines that look like this:
  $databases['default']['default']['prefix']= array(
    'default' => '',
    'civicrm_acl'                              => '`username_civicrm`.',
    'civicrm_acl_cache'                        => '`username_civicrm`.',
    'civicrm_acl_contact_cache'                => '`username_civicrm`.',
    'civicrm_acl_entity_role'                  => '`username_civicrm`.',
    'civicrm_action_log'                       => '`username_civicrm`.',
    'civicrm_action_mapping'                   => '`username_civicrm`.',
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-19T00:12:30.907Z
Answers.Text: It should be a very long array that includes the names of all your CiviCRM tables. Unfortunately comments don't format them correctly. I'll add it as an edit above to see if that works better.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-19T19:47:54.800Z
Answers.Text: I'm not finding anywhere that Joomla includes an array of db tables. Not that it isn't somewhere, but I am not finding it. I did find some other possibilities, but those didn't help. It's too involved to put in a comment. I'll edit my answer to add those attempts.
Answers.UserDisplayName: Phil Morice Brubaker
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-20T03:28:41.657Z
Answers.Text: Do you have a menu item like this: CiviCRM Menu >> Administer >> System Settings >> CMS Database Integration
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-20T16:50:50.200Z
Answers.Text: Yes, but it only has an option to sync CMS email.
Answers.UserDisplayName: Phil Morice Brubaker
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-21T00:47:20.167Z
Answers.Text: Only for email? This should be a page for *database* integration, not email.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-21T18:02:22.390Z
Answers.Text: Yes. That is the only option - in both our production and dev sites: Settings - Joomla Integration / These settings define the CMS variables that are used with CiviCRM. >> Sync CMS Email Yes No
  Save Cancel
Answers.UserDisplayName: Phil Morice Brubaker
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-16T04:34:38.220Z
Answers.LastActivityDate: 2017-12-19T00:14:04.780Z
Answers.LastEditDate: 2017-12-19T00:14:04.780Z
Answers.UserDisplayName: Jenni Simonis
Body: <p>We are working on a long-needed update of our website. I thought I would take the opportunity to also follow what many say is best practice and move our Civi db out of a db shared with our Joomla CMS. I have done this on our development site, and so far so good. Except, that when trying to create a new CiviEvent Listing Joomla module, I get this error: "<em>Table '[organization]_dev.civicrm_event' doesn't exist</em>"</p>
  
  <p>It is true that doesn't exist, because it should be looking for <em>[organization]<strong>_dev_civi</strong>.civicrm_event</em>. The db <em>[organization]_dev</em> is the CMS only. I've reconfirmed that my database settings are correct in civicrm.settings.php in both Administrator and component. I've cleared the Joomla cache.</p>
  
  <p>Any ideas what's going on? Where else can I look? </p>
  
  <p>UPDATE:</p>
  
  <p>In searching for possible fixes, I have made the following changes, to no avail:</p>
  
  <p>Added this line in CMS config file (www/dev/configuration.php) under class JConfig:</p>
  
  <pre><code>public $cividb = 'username_dev_civi';
  </code></pre>
  
  <p>in www/dev/administrator/components/com_civicrm/configure.php   </p>
  
  <pre><code>     'dbName' =&gt; $jConfig-&gt;db,
  </code></pre>
  
  <p>changed to </p>
  
  <pre><code>    'dbName' =&gt; $jConfig-&gt;cividb,
  </code></pre>
  
  <p>In CiviEvent Listing module file (www/dev/modules/mod_civievent/helper.php)</p>
  
  <pre><code>    $db = JFactory::getDBO();
  </code></pre>
  
  <p>Changed to</p>
  
  <pre><code>    $db = 'username_dev_civi';
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-02-07T17:35:31.567Z
Comments.Text: I just came across this from the Civi Admin Guide. It isn't a solution to this particular problem (I've moved on at this point and put the Civi DB back into the CMS db.), but it at least provides evidence that there are files in Civi Core beyond civicrm.settings.php that need to be changed in order to fully integrate with the Joomla front-end.
  
  https://docs.civicrm.org/sysadmin/en/latest/integration/joomla/forms/#trouble-shooting
Comments.UserDisplayName: Phil Morice Brubaker
Tags: <joomla><database><cms-integration>
Title: CiviEvent Listing module in Joomla not finding database table
ThreadText: # CiviEvent Listing module in Joomla not finding database table
  
  (Asked by: username_0 on 2017-12-15)
  
  We are working on a long-needed update of our website. I thought I would take the opportunity to also follow what many say is best practice and move our Civi db out of a db shared with our Joomla CMS. I have done this on our development site, and so far so good. Except, that when trying to create a new CiviEvent Listing Joomla module, I get this error: "*Table '[organization]\_dev.civicrm\_event' doesn't exist*"
  
  It is true that doesn't exist, because it should be looking for *[organization]**\_dev\_civi**.civicrm\_event*. The db *[organization]\_dev* is the CMS only. I've reconfirmed that my database settings are correct in civicrm.settings.php in both Administrator and component. I've cleared the Joomla cache.
  
  Any ideas what's going on? Where else can I look?
  
  UPDATE:
  
  In searching for possible fixes, I have made the following changes, to no avail:
  
  Added this line in CMS config file (www/dev/configuration.php) under class JConfig:
  
  ```
  public $cividb = 'username_dev_civi';
  
  ```
  
  in www/dev/administrator/components/com\_civicrm/configure.php
  
  ```
       'dbName' => $jConfig->db,
  
  ```
  
  changed to
  
  ```
      'dbName' => $jConfig->cividb,
  
  ```
  
  In CiviEvent Listing module file (www/dev/modules/mod\_civievent/helper.php)
  
  ```
      $db = JFactory::getDBO();
  
  ```
  
  Changed to
  
  ```
      $db = 'username_dev_civi';
  
  ```
  
  **Tags:** joomla, database, cms-integration
  
  > **Comments:**
  > **username_0**: I just came across this from the Civi Admin Guide. It isn't a solution to this particular problem (I've moved on at this point and put the Civi DB back into the CMS db.), but it at least provides evidence that there are files in Civi Core beyond civicrm.settings.php that need to be changed in order to fully integrate with the Joomla front-end.  https://docs.civicrm.org/sysadmin/en/latest/integration/joomla/forms/#trouble-shooting  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-12-16. Score: 0
  
  Sounds like you also need to update the settings inside your file that points to your Joomla database. I don't know exactly where that is, as I use Drupal. But mine is at /home/username/public\_html/sites/default/settings.php. That is where I tell Drupal how to connect to its database. Every CMS I've ever worked with has something similar. Inside that file is a listing of CiviCRM database tables so that your CMS can connect. If you haven't changed it there, then Joomla is still looking for the old database.
  
  Edit:
  
  The lines you're editing in your CMS's settings file would look similar to this below. Unfortunately it doesn't get formatted right when pasting in here, so I've only included the first dozen lines or so.
  
  ```
  $databases['default']['default']['prefix']= array(
    'default' => '',
    'civicrm_acl'                              => '`username_civicrm`.',
    'civicrm_acl_cache'                        => '`username_civicrm`.',
    'civicrm_acl_contact_cache'                => '`username_civicrm`.',
    'civicrm_acl_entity_role'                  => '`username_civicrm`.',
    'civicrm_action_log'                       => '`username_civicrm`.',
    'civicrm_action_mapping'                   => '`username_civicrm`.',
    'civicrm_action_schedule'                  => '`username_civicrm`.',
    'civicrm_activity'                         => '`username_civicrm`.',
    'civicrm_activity_contact'                 => '`username_civicrm`.',
    'civicrm_address'                          => '`username_civicrm`.',
    'civicrm_address_format'                   => '`username_civicrm`.',
  
  ```
  
  > **Comments:**
  > **username_0**: I don't think that's it. I did change the CMS settings.php to point to the dev database, and that is the database that the CiviEvent Listing module is trying to connect to. And, the dev site and other parts of Civi in the dev environment are all functioning normally.  
  > **username_1**: So you changed a bunch of lines that look like this: $databases['default']['default']['prefix']= array(   'default' => '',   'civicrm_acl'                              => '`username_civicrm`.',   'civicrm_acl_cache'                        => '`username_civicrm`.',   'civicrm_acl_contact_cache'                => '`username_civicrm`.',   'civicrm_acl_entity_role'                  => '`username_civicrm`.',   'civicrm_action_log'                       => '`username_civicrm`.',   'civicrm_action_mapping'                   => '`username_civicrm`.',  
  > **username_1**: It should be a very long array that includes the names of all your CiviCRM tables. Unfortunately comments don't format them correctly. I'll add it as an edit above to see if that works better.  
  > **username_0**: I'm not finding anywhere that Joomla includes an array of db tables. Not that it isn't somewhere, but I am not finding it. I did find some other possibilities, but those didn't help. It's too involved to put in a comment. I'll edit my answer to add those attempts.  
  > **username_1**: Do you have a menu item like this: CiviCRM Menu >> Administer >> System Settings >> CMS Database Integration  
  > **username_0**: Yes, but it only has an option to sync CMS email.  
  > **username_1**: Only for email? This should be a page for *database* integration, not email.  
  > **username_0**: Yes. That is the only option - in both our production and dev sites: Settings - Joomla Integration / These settings define the CMS variables that are used with CiviCRM. >> Sync CMS Email Yes No Save Cancel  
  
  ---
  
  