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) »
  • "Database partially upgraded"-error
Pages: [1]

Author Topic: "Database partially upgraded"-error  (Read 1266 times)

Martin

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.2.9
  • CMS version: joomla 2.5
  • MySQL version: unknown
  • PHP version: 5.3
"Database partially upgraded"-error
May 01, 2013, 01:35:04 pm
I tried to upgrade from civicrm 4.2.1 to 4.2.9 on joomla 2.5
the database-upgrade-progress stopped at about 50% while trying to upgrade a table to 4.3 (?!).
I was not able to rerun the databse-upgrade and also was not able to undo the partial upgrade.
The database-backup showed up to be unuseable and civicrm 4.2.9 causes error-messages.
How can I undo or finish the upgrade automatically or manually?

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: "Database partially upgraded"-error
May 01, 2013, 03:01:06 pm
Martin - getting through the upgrade step by step might be a real chore. My advice would be to first review your DB backup to identify *why* it's unusable, because fixing that issue is likely a path to a much quicker solution.

That said, CiviCRM stores its upgrade processes in civicrm/CRM/Upgrade/ - there are .SQL and .PHP files in that folder (eg CRM/Upgrade/Incremental/php/FourOne.php, and CRM/Upgrade/Incremental/sql/4.2.alpha1.mysql.tpl). If you extract the statements from those files, and execute them in the correct order, you could then upgrade manually.

This is not a task for the faint of heart, nor one you should undertake lightly. See if you can get back to a recent backup, then go forward from there.

I've added a note to the upgrade guide recommending people to test backups before upgrading. I don't know if it'll get seen or just add to the many screens of warnings and notes already there, but I hope it helps someone.

FWIW, my process is to use the DB backups to test a reproducible upgrade process until that works flawlessly, then repeat the same process on the live site.
@xurizaemon ● www.fuzion.co.nz

Martin

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.2.9
  • CMS version: joomla 2.5
  • MySQL version: unknown
  • PHP version: 5.3
Re: "Database partially upgraded"-error
June 29, 2013, 07:33:07 am
Thanx Chris.

The Backup is unuseable because it is to old (the cronjob for the backup did not work properly). Therefore there are about 4000 entries missing...

I am checking with my hoster if i can get the logging disabled to be able to use a newer version of civicrm, but the database-problem still presists.

I am not that professional that I can define which and to execute the sql-statements on the server.
I could run php on the server or acess myphpadmin.

Isn´t there any repair-utility?

If I cant repair the database I would rather uninstall civicrm and use another software than trying to reinstall it. I would need to export all data to .csv or .xls properly to be able to import it in another crm...

Shall I use the 4.3-version or a 4.1 with the partialy updated database in the meantime?

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: "Database partially upgraded"-error
June 29, 2013, 03:23:51 pm
Use whatever works. You'll only be able to work out which of the two evils (4.1 or 4.3 on a 4.unknown DB state) is less worse by testing yourself. If it's letting your contacts do the basics and you aren't losing data, maybe that's not so bad.

Understandable that a DB backup from two months ago isn't going to be much help at this point. You may well be best off exporting to CSV and starting again (either with CiviCRM on a suitable hosting platform, or another software entirely). Don't shy away from that approach, it may do what you need to get fully operational again.

That said, here's my notes on taking the rockier road :)

The "repair" method I've used recently on a heavily customised DB which had trouble upgrading was to dump data to a data-only .sql file, reload the DB schema from the schema supplied with your DB, then reload the custom data from your .sql into the fresh DB.

I've been using a this bash script (modified for publication) to do this to a customised DB locally. That script does more than what you need, but it should cover what you need to do.

If you're stuck in a "partially upgraded" DB state, you (or your developer) will need to make your way through the upgrade steps and identify where your upgrader got to. By manually applying (or unapplying) a few updates for that minor version, you should be able to put your DB in a state which the upgrader can identify and support progress from.

Good luck.

@xurizaemon ● www.fuzion.co.nz

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • "Database partially upgraded"-error

This forum was archived on 2017-11-26.