Recent Topics

Problem Upgrading from V 4.1.7 to 5.0.5

Started by on Sep 06, 2013 – Contents updated: Sep 19, 2013

Sep 06, 2013 04:21    

While upgrading to newest version, installation gets stuck at a point, it says:

Renaming Countries table...
An unexpected error has occurred!

If this error persists, please report it to the administrator.

I can't get from that point.

Any Ideas?

Sep 06, 2013 15:53

Turn on debugging.


$debug =1;

In your advanced config file.

Then run install again (on a backup of your 4.1.7 DB) and it will give more information about the error.

Please make a screenshot of full debug info and also tell me the time elapsed since your last click.

Sep 06, 2013 16:19


Thanks for your reply. I turned debugging on but didn't install on a 4.1.7 backup because I only made a MySQL backup but not the rest since I thought I wouldn't have any trouble upgrading. I thought this way because upgrading has always been a very easy task with b2evolution... Its my mistake.
But this is the message I'm getting right now:

An unexpected error has occurred!

If this error persists, please report it to the administrator.

Volver a la pƔgina de inicio
InformaciĆ³n adicional sobre este error:

MySQL error!

Table 'evo_regional__country' already exists(Errno=1050)

Your query:

RENAME TABLE evo_country TO evo_regional__country


debug_die( "<p class="error">MySQL error!</p>\n<div><p><strong>Table 'evo_regional__country' already exists(Errno=1050)</strong></p>\n<p class="error">Your query: </p><pre>RENAME TABLE evo_country TO evo_regional__country</pre></div>\n" )
File: /home/eduard8/public_html/ on line 664
DB->print_error( "", "", "" )
File: /home/eduard8/public_html/ on line 877
DB->query( "RENAME TABLE evo_country TO T_regional__country" )
File: /home/eduard8/public_html/ on line 3328
upgrade_b2evo_tables( "evoupgrade" )
File: /home/eduard8/public_html/ on line 730

Ignored last: 1

Sep 06, 2013 16:34

Time elapsed after last click would be less than a second.

Sep 06, 2013 18:05

The database is messed up already.
You need to edit the upgrade script, apply changes manually up to the next checkpoint. Look at the script where it says "Renaming Countries table", see what changes were actually applied (look at the database), move the checkpoint up to skip those changes on the next upgrade run.

You should create checkpoints more often, it doesn't hurt to have a few extra DB calls at upgrade time, however it will make upgrades a lot safer.

Sep 06, 2013 18:14

@gcasanova it is not clear to me whether you restored your MySQL backup (made at the time of 4.1.7) prior to this upgrade or not.

You definitely DO NOT want to restore your 4.1.7 files. I was talking exclusively about the DB backup.

Also I regret you did not send a screenshot because I need to see what happened BEFORE "An unexpected error has occurred!". Furthermore the screenshot give a lot of visual info which helps recognize common problem. When you retain that kind of info from me you make it harder for me to help you.

@sam2kb I know ;)

Sep 06, 2013 18:20

@gcasanova Most likely things to resolve your problem:

1) Make sure you DROP all tables from your DB before restoring your DB backup. There must be NO table in the DB before loading the backup.

2) Once you have restored the backup, make sure the table evo_regional__country does NOT exist. (If it does, please look if there is another table for countries and if it's a duplicate or not.)

3) re-run the upgrade and if you still have an error, please make a complete screenshot.

Thank you.

Sep 06, 2013 18:36

Sorry but I'm a bit (a lot) confused about all this.
I'm attaching a PDF file with an image of what happens when I update. Hope that is what you're asking me for.

I don't know about this but, what if I delete the evo_regional_country with PHPMyAdmin?


Sep 06, 2013 18:40

You can try to delete it with PHPMyAdmin indeed.

You did not answer most of my questions. You especially did not tell me if you followed steps 1, 2 and 3 above.

For example, if you only followed step 3, then the print results are of absolutely no use.

Sep 06, 2013 18:59

Sorry and please be patient with me because there's more to this.

I haven't followed steps 1 and 2 because I am not sure at all if I made the MySQL before or after getting the error. But I'm doing it right now.

Let me do this and I will get back with results.

Thank you!

Sep 06, 2013 19:17

Step 1 ready, now, there is an evo_country table. Should I keep it or what?

Sep 06, 2013 20:09

1) Ready

2) Table evo_country existed and I dropped it

3) Ran installer and got error (screenshot attached)

Sep 06, 2013 20:15

You should NOT delete evo_country . You should only delete evo_regional__country if it exists.

Now your screenshot says evo_country doesn't exist but it's normal because you deleted it.

Again, in step 2 you should only delete evo_regional__country if it exists. You should nOT delete any table with a similar name. Just let me know if there are several tables that seem to contain the list of countries. Do NOT delete any table that is not called exactly evo_regional__country. Do NOT delete any table if you don't see multiple country tables.

Sep 06, 2013 20:31

Right now I'm doing the three steps again... I'm waiting for the PhpMyadmin restore.

Sep 06, 2013 20:37

Did as told, now I get this new error (screenshot shown)

Sep 06, 2013 21:50


First this is a completely different error than the first time. The first time you had a problem when "Renaming Countries table..." (your first message). Then you did a lot of things and finally restored your backup and now we see "Renaming Countries table... OK".

Now you have another problem that should not exist when doing an upgrade from v 4.1.7 to 5.0.3.

It looks to me you have done some serious tampering with your database. It is extremely difficult to recover from that. You should never touch your database unless you know exactly what you are doing. When you don't know, all you should do is backup, remove all tables and restore.

Here something bad has happened to your database.

The clean way to fix this is to restore a clean MySQL backup of a previous version of b2evolution that was backed up before doing anything weird with the database. This also means a backup from before the upgrade.

If you don't have a clean backup to restore and to work with, you have to read the error messages and act accordingly. It will be a tedious case-by-case process. Here it says the table "evo_track__keyphrase" doesn't exist. This table exists in all 4.1.7 installations. Find why your table doesn't exist.

Alternatively you can modify the upgrade script to work with your particular situation, but that is probably even harder to do.

To sum this up: the database you are trying to upgrade is NOT a clean 4.1.7 database. The upgrade script can only work on a clean database that has not been modified. I don't know who or what tampered with your database but this is the problem you need to fix: restore a clean backup OR tweak your database to make it look like a 4.1.7 database again.

Alternative: hire someone (not me) to look at every detail that is wrong with your DB until it works again.

Sep 06, 2013 22:51

What happened with the database, I really don't know.

I was working with version 4.1.7
I uploaded version 5.0.4 but I don't remember if I tried to install the new version or overwrote the new version with th 5.04 to 5.0.5 patch
Then I upgraded from 5.0.4 to 5.0.5

It failed on the way.

Moments ago I took an old copy of evo_track_keyphrase from another blog (the one for the troubled blog simply disappeared), imported it, emptied it and tried to install 5.0.5 again. It worked.

Now, the keyphrases are empty and I don't know how that will affect the blog. But at least it is working.

What do you suggest I should do next and what do you think could happen because of what I did?

Sep 07, 2013 01:01

I'm glad it worked out for you :)

The evo_track_keyphrase table is only for trackign what keyphrases people type in the search field of your site.

Having no or wrong data there will only affect your stats. You may need to also delete content from the tables that reference evo_track_keyphrase in order to restore completely clean status. But (at your own risk) you can also wait to see if you have a problem with stats or not.

Form is loading...

Free blog engine – This forum is powered by b2evolution CMS, a complete engine for your website.