Trying to upgrade a 4.1.5 database to 4.2.6. I am getting a constraint violation. See the screenshot.

CiviCRM upgrade tasks

Attempted upgrade from 4.1.5 to 4.2.20

2 Answers 2


I recommend you take smaller steps, starting with 4.2. You can download the latest version of 4.2 from sourceforge (the latest in that series is currently 4.2.20).

If that upgrade goes ok, then you could proceed to 4.4 (the current LTS) and then up to 4.6.

Remember to backup your database before upgrading, and if the upgrade fails, restore from the backup before trying again.

  • I have treid to update to 4.2.20. from 4.1.5. I immediately get an error that a table exits. I've attached the screen shot to the original question
    – Vietyank
    May 25, 2015 at 3:38
  • Are you sure you are starting with a 4.1 db that hasn't already been partially upgraded?
    – Coleman
    May 25, 2015 at 14:20
  • That should not be the case. It is a mysqldump of the current production database.
    – Vietyank
    May 26, 2015 at 3:09

You may not care to keep all the log info in your live database so long as you have a backup. If so, run

TRUNCATE civicrm_log;

on your sql db before running the upgrade.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.