Upgrading from 2.0.7 - there can be only one auto column and it must be defined

Started by abean, February 03, 2015, 07:48:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

abean

Hey all,

Attempting to revive a 5 year old site that was running an ancient version of SMF. I got SMF all up to date (2.0.9); however after doing so (not sure If I screwed it up or not), all my mods weren't showed as installed.

So I've been slowly working through each mod and now I'm at the arcade. When installing 2.6, I get the error:
Incorrect table definition; there can be only one auto column and it must be defined as a key
File: Packages/temp/arcadeinstall/Subs-Install.php
Line: 120

Here's that block of code:
// Primary is special case
if ($index['type'] == 'primary' && $index2['type'] == 'primary')
{
$exists = true;

if ($index['columns'] !== $index2['columns'])
{
$smcFunc['db_remove_index']('{db_prefix}' . $table_name, 'primary');
$smcFunc['db_add_index']('{db_prefix}' . $table_name, $index);
}

break;
}


Any help would be most appreciated!

Thanks

Skhilled

Hi abean and welcome to Docskillz! :)

1.  What was the version of SF you upgraded from?

2.  If the previous SMF version was 1.x then none of your mods would have worked anyhow when upgrading to 2.x versions. That being said, even if they are old 2.x mods they may cause problems if they were not uninstalled correctly before reinstalling them.

To me, it sounds like your database may need to be upgraded. First, you'll need to get rid of all of the old mods. I suggest using the same database but also using all new SMF files for 2.0.9. This way, you won't have to worry about mod conflicts. Keep in mind that if you are trying to install outdated mods you can have problems.

Can I see a link to your site?

abean

Hi Skhilled,

1. Not sure to be honest ... already did the upgrade and not sure what version I used to be. It was from 2009 and a 1.x version.
2. Ah, so that would be why all my mods showed up as uninstalled then huh? Good to know!

When you say get rid of the mods, how do I do so? None show as installed anymore so I just moved them all to a new folder for the time being. From there, what do you mean by upgrading the database? What in specific needs to be done?

Thanks!

Skhilled

I do suggest doing this on a test site to see how it works first. ;)

1.  Backup your files and your database.

2.  Delete all files your SMF files on your site.

3.  Download the SMF 2.0.9 Upgrade package and upload all of the files. If you have cPanel you can just upload the zip then "Extract" them..it'll be much faster.

4.  Run "http://yoursite.com/upgrade.php" - "yoursite.com", of course, would be the actual name of your domain and subfolder if using one. Then follow the prompts to upgrade your database. This should upgrade your files and database to 2.0.9. Remember, it not just enough to upgrade the files without upgrading the db as well. Then add your logo and any other custom images.

Test your site to make sure it runs ok without and themes or mods. If all is good then:

5.  Install your themes first! Mods will look for themes and install their code to them. But if you install the mods first, you must manually edit your themes to make them work with your mods! Then test each theme to make sure they work.

6.  Install your mods one by one and testing each one before installing the next. If you have a problem with a mod you must fix it before installing the next or at least document any problems or errors in your logs.

I suggest installing your largest mods first then any small ones. By size, I mean if they contain a lot of code. It will be a lot easier to edit a small mod later than a large one after having a bunch of mods installed.

abean

Hey Skhilled,

That is more or less how I did the upgrade. I did in place on the 1.x versions and then uploaded 2.09 and ran the upgrade.php.

This particular error is referencing a column in a table that is unique to the arcade yeah? So not sure how going through all this again would be beneficial.

Skhilled

Have you removed the old arcade tables first? It seems that there is a conflict of sorts with tables already in place. The old tables may be corrupted or just because it is from a version so old there's a problem.

abean

Quote from: Skhilled on February 04, 2015, 07:09:19 AM
Have you removed the old arcade tables first? It seems that there is a conflict of sorts with tables already in place. The old tables may be corrupted or just because it is from a version so old there's a problem.

Negative, ideally I'd like to preserve the old games/scores ... but is that not possible?

Skhilled

I'm trying to remember but think not, unfortunately. I "think" the db table structure changed from 1.x to 2.x. too much and I think Niko rewrote it and you could not keep your scores, etc.

The only way to prove it would be to compare new db tables with your old.

Ken.

My site was offline for a long time like yours Adam and like you I had problems getting the Arcade to work when reviving my site.

After several attempts and over several months it finally came down to dropping all of the db files for the Arcade and then doing a fresh Arcade Package upload.
" If everything seems under control, you're not going fast enough." - Mario Andretti

Skhilled

Yeah, if I remember correctly a lot of mods (and tables/fields) had to be dropped when 2.0 was finally released. I remember helping some people and had to do that to get their db's to upgrade properly. That was prior to installing any mods.

EDIT: I think you should make a test site and do it there first. If you do not know how to make a test site then read this:

http://www.docskillz.com/docs/index.php?page=page201

It will be an exact duplicate of your live site so follow the directions carefully. Make sure you do something so when you see it you will know the difference since they will be identical, except maybe for the themes. Give your db, the folder you put it in and the name of the site a different name and name them all the same like "test" or something you will immediately know that it is not your live site. Then do what you will. If you mess it up, no problem...just rebuild it. But you won't mess up your live site in the process! ;) Trust me, you will learn a lot from doing this!

Just make sure you run repair_settings.php after you set it up so it points to your test site and not your live site!!! Then play with it until you're satisified!

abean

Ugh, what a bummer.

No way to just find out what table is in question and manually edit huh?

Skhilled

Probably not without editing other tables and/or fields and that is beyond my knowledge.