News:

Wondering if this will always be free?  See why free is better.

Main Menu

Error on SQL import of backup data

Started by damacguy, March 01, 2007, 06:20:50 PM

Previous topic - Next topic

damacguy

We're rebuilding our server with updated OS and want to start with a clean SMF install, but retain our data.

I've backed-up the complete SQL database from the Admin -> Maintenance section of our forum that's in use (v1.1.2). Gzipped file is 836KB in size.

I have a clean install of SMF (v1.1.2) on our new server. We're using phpmyadmin 2.9.2, MySQL 5.0.24a, PHP 5.2.1.

First attempt:
Allowed new SMF forum to install database tables, imported backup, and get the following error "#1062 - Duplicate entry '6-83' for key 1"

Second attempt:
Purged all data from the newly installed database tables. Imported backup, and get the following error "#1062 - Duplicate entry '6-83' for key 1"

Third attempt:
Deleted database created by SMF during installation. Created new, empty database called smf. Imported backup, and get the following error "#1062 - Duplicate entry '6-83' for key 1"

Why am I getting this error?

How can I fix this problem?

I've searched, and seen others with similar errors, but no solutions posted.

青山 素子

Temporarily remove the indexes on the problem table, then create them again after the import is done.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


damacguy

Thanks for the response.

Is removing indexes an sql command line function, or is this something that can be done through phpmyadmin. I'm looking in phpmyadmin, but can't see an option to remove the indexes. I'm not even really sure I understand what an index is in sql (I understand tables in the database, and assume that an index is a list of entries in each table?).

Running check table on all the tables in my smf database I get the following errors...
Problems with indexes of table `backup_smf_messages`
UNIQUE and INDEX keys should not both be set for column `ID_TOPIC`

Problems with indexes of table `smf_messages`
UNIQUE and INDEX keys should not both be set for column `ID_TOPIC`
UNIQUE and INDEX keys should not both be set for column `ID_MEMBER`
More than one INDEX key was created for column `ID_MEMBER`

Problems with indexes of table `smf_settings`
More than one FULLTEXT key was created for column `variable`

青山 素子

In phpMyAdmin, view a table (the structure) and look down toward the bottom. There will be an area marked "Indexes". Drop the unique one that has the problem column in it. Remember to re-create it when you are finished with the import. You can get the creation command from the .sql file that is included with SMF.

An index in a database is just like an index in a reference book. Like the one in a book, an SQL index is designed to make looking up information faster as the location of certain items are already known. This speeds things up considerably, especially as more data is put in a table.

Those "problems" shown in phpMyAdmin are fine to ignore, and aren't really a problem.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


damacguy

Well, I'm making progress.

The table that's giving me problems is smf_log_search_subjects. There aren't any indexes in it, but I emptied it (made a backup of the database in phpmyadmin first though).

Importing the backup made by SMF works fine. But now I get a Database error in the new forum.

two steps forward, one step back. But at least I'm getting closer. ;D

codenaught

Hi damacguy, do you still need assistance with this?
Dev Consultant
Former SMF Doc Coordinator

damacguy

Thanks for checking. I got it imported.

Thanks!

greyknight17

Glad it's resolved :)

Just in case other users have a similar issue, what did you do to resolve the problem?

Advertisement: