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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Upgrading from 3.0.4 to 3.1.3 on Joomla 1.5
Pages: [1]

Author Topic: Upgrading from 3.0.4 to 3.1.3 on Joomla 1.5  (Read 1633 times)

ddmobley

  • Guest
Upgrading from 3.0.4 to 3.1.3 on Joomla 1.5
March 03, 2010, 10:35:57 am
Recently, I needed to upgrade a CiviCRM/Joomla installation from 3.0.4 to 3.1.3.  When attempting the upgrade from 3.0.4 directly to 3.1.3, I encountered an error

Code: [Select]
   Sorry. A non-recoverable error has occurred.

    DB Error: no such table

    Database Error Code: Table 'client_joomla.civicrm_contact_type' doesn't exist, 1146

    Return to home page.

In reading some of the posts here on that error, I found out that I needed to upgrade to 3.1.1 before moving on to 3.1.3.  So, I removed all of the MySQL tables for CiviCRM and reinstalled the backup, proceeded to download 3.1.1, and then upload that to Joomla.  When running the installer, everything went fine, but the upgrade process broke again with the same error.

Code: [Select]
   Sorry. A non-recoverable error has occurred.

    DB Error: no such table

    Database Error Code: Table 'client_joomla.civicrm_contact_type' doesn't exist, 1146

    Return to home page.

At this point, I came here and read some more where I saw a user who had some success with manually adding the civicrm_contact_type table to the database before running the upgrade process.  So I extracted just the civicrm_contact_type table creation from the 3.1.1 CiviCRM SQL install file and repeated the process, except for adding the civicrm_contact_type table before clicking upgrade the database.

The database upgrade got to the green screen and I thought I was home free.  I clicked on it to continue, where it told me that the civicrm_contact_type table already exists. Hmmm.

So, I backed everything out again and started over, this time I manually added the civicrm_contact_type before clicking the upgrade database link and when it reached the green screen, I deleted the civicrm_contact_type table from the database and clicked on the green screen to continue.  I knew this was it!

I was wrong.  It gave this error:

Code: [Select]
   Sorry. A non-recoverable error has occurred.

    DB Error: a515ac9c2796ca0e23adbe92c68fc9fc

    Database Error Code: Error on rename of './client_joomla/civicrm_custom_group' to './client_joomla/#sql2-2d78-1cd08' (errno: 152), 1025

    Return to home page.

As much as I had avoided it, it was apparent I was going to have to rebuild the database as shown in this page: http://wiki.civicrm.org/confluence/display/CRMDOC/Ensuring+Schema+Integrity+on+Upgrades

That page doesn't seem to take into consideration those individuals who have their CiviCRM data and tables inside their CMS system's database.  Building a new database and just importing the civicrm.mysql startup file doesn't do anything for those people who have Joomla or Drupal tables to consider.  Also, the initial Joomla SQL initialization file wouldn't include all of the components, modules, and plugins the client had installed after installation, so I was going to have to do something different.  In the end,  I followed the spirit of the instructions on that page but not verbatim.

After uninstalling the CiviCRM installation from the Joomla install/uninstall component, I deleted all of the CiviCRM tables from the database in order to re-import the database as it stood before attempting the upgrade.  Next, I created my CiviCRM datafile:

Code: [Select]
mysqldump -u client -ppassword -c -e -n -t client_joomla > datafile.sql
Then I created my structure file with a very important caveat that is not shown on the scheme structure integrety help page!  If you have custom_import_job tables in your database, you need to grab them as well as the civicrm_value_custom tables:

Code: [Select]
mysqldump -d -u client -ppassword client_joomla civicrm_value_custom_2 civicrm_value_custom_3 civicrm_value_custom_4 civicrm_value_custom_5 civicrm_import_job_1b40732bd1cb09a37395b8e3b8084831 civicrm_import_job_24e35bd81a948832cbd50ee7ff2564d0 civicrm_import_job_de16f477148ad42c0a4b1f04c614ed21 civicrm_import_job_f9dd40ff522157df66332b8c7933adcd civicrm_import_job_fe39c5a9f8299bc0afe139d53240572f  > customfieldsfile.sql
I then download the files generated to my desktop and then dropped all of the CiviCRM tables from the database.  When finished, I checked and optimized the remaining tables in the client_joomla database, in order to clean it up to re-import the data.

With the clean database ready to accept the CiviCRM data, I extracted the civicrm.mysql install file from my CiviCRM 3.0.4 zip file and imported it via phpMyAdmin.  

Next, I imported the customfieldsfile.sql structure file via phpMyAdmin.

Before I imported the datafile.sql, I opened the data file and deleted every non-CiviCRM line of data, which was all of the Joomla stuff, saved it and then imported it with phpMyAdmin.

I then uploaded the 3.1.1 install files to Joomla and installed them.  Clicking on through to the upgrade database link brought me to the green screen and clicking on through the upgrade brought me to a 3.1.1 upgrade success message.  FINALLY!  From there, it was just uploading the new 3.1.3 installation files and repeating the process.

I have learned from this to make sure you backup at every beginning and at every successful step completion in order to keep some semblance of sanity in your life.  I hope this helps someone else who might find themselves in my shoes somewhere down the road.
« Last Edit: March 03, 2010, 10:42:58 am by ddmobley »

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: Upgrading from 3.0.4 to 3.1.3 on Joomla 1.5
March 08, 2010, 04:23:19 am
ddmobley, thanks for sharing it. Few comments:

1. There is NO need to upgrade to 3.1.1 before moving on to 3.1.3. You can directly move on to 3.1.3. I think its the schema rebuilding that solved your issue.

2. IMO "civicrm_contact_type' doesn't exist" error happens when you have installed the new codebase and -
a. try to access any another screen other than civicrm/upgrade, since the new code expects that table to be present.
- OR -
b. try to access civicrm/upgrade, but due to incorrect url civicrm try to visit default civicrm/dashboard screen, throwing the same error like 2a.

If 2a or 2b is not the case and you can give us the backtrace with url, we can debug and fix the problem, which 'll also help other folks.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

cleit

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
Re: Upgrading from 3.0.4 to 3.1.3 on Joomla 1.5
March 25, 2010, 02:02:01 am
I got the same error when upgrading from 3.0.1 to 3.1.3. I just did the install and immediately clicked the upgrade database link, which produced:
Code: [Select]
   DB Error: no such table

    Database Error Code: Table 'opencano_ocasite.civicrm_contact_type' doesn't exist, 1146

    Return to home page.

Error Details:

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -18
    [message] => DB Error: no such table
    [mode] => 16
    [debug_info] => SELECT *
 FROM civicrm_contact_type
 
 WHERE (  civicrm_contact_type.name  = 'Individual' )  
 
 
 
 [nativecode=1146 ** Table 'opencano_ocasite.civicrm_contact_type' doesn't exist]
    [type] => DB_Error
    [user_info] => SELECT *
 FROM civicrm_contact_type
 
 WHERE (  civicrm_contact_type.name  = 'Individual' )  
 
 
 
 [nativecode=1146 ** Table 'opencano_ocasite.civicrm_contact_type' doesn't exist]
    [to_string] => [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT *
 FROM civicrm_contact_type
 
 WHERE (  civicrm_contact_type.name  = 'Individual' )  
 
 
 
 [nativecode=1146 ** Table 'opencano_ocasite.civicrm_contact_type' doesn't exist]"]
)



EDIT: OK problem solved by following workaround no 1,:http://forum.civicrm.org/index.php/topic,12466.msg55157.html#msg55157
[/code]
« Last Edit: March 25, 2010, 02:26:25 am by Deepak Srivastava »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Upgrading from 3.0.4 to 3.1.3 on Joomla 1.5

This forum was archived on 2017-11-26.