(Closed) restore pr...
 
Notifications
Clear all

(Closed) restore problem-#1062 - Duplicate entry '1' for key 1

6 Posts
3 Users
0 Reactions
1,583 Views
(@msmelanie1)
Posts: 17
Active Member
Topic starter
 

URL to your eFiction: http://notsoinnocent.net
Version of eFiction: 3.1.5
Have you bridged eFiction, if so with what?: not bridged
Version of PHP:5.2.4
Version of MySQL: 5.0.27
Have you searched for your problem: Yes!

If so, what terms did you try:database, shared  database, database connection, restore database, restore, and a ton more. Been searching all day.
State the nature of your problem:

Okay, I tried to follow the steps to merge a pre-existing efiction with a brand new efiction, but it didn't work and my other one got screwed up. I easily fixed it, but something happened. My fanfiction_settings no longer existed, but it did under a different name. I changed it to what the program wanted, but it caused a different error (The usual cannot modify header on line 88, already exists on 152.)

I wanted to try to restore my database but it keeps saying #1062 - Duplicate entry '1' for key 1. I think it's getting meshed up with the other tables, but I have never restored before.

So either I need to figure out my table problem or my restore problem. (I think restore would be easier.) If I gave the site a clean install then restored it with the backup file, would it work finally? Or would it make things worse?

Sorry I am a complete noob to php and mysql and I am slowly, slowly learning.


Php 5.2.4| Mysql 5.0.27|Efiction 3.5.1|

 
Posted : 15/09/2009 6:12 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

When you say "merge a pre-existing efiction with a brand new efiction" what exactly to do you mean? Are you trying to merge two separate databases together, or are you trying to port over an existing database to a new install of just the files? (It sounds like the former.)

You can quite easily create a new installation (on a new server or what have you) using a database backup copy. The trick is not to run the install (install/install.php) so that it will not try to create new tables on top of the existing ones from the backup. (Though you may need to let update.php run if your database is not at 3.5.1.)

If you managed to merge together two sets of tables, the easiest thing would be to scrap it. Do you have an unchanged backup copy? If so, that's all you need. If you don't, make sure you've only got one copy of each table. Look at each table individually and look at the keys/indexes and see if anything's duplicated (sounds like it is). You may have duplicates of other data, depending on what was in each database. For instance, you may have two users in fanfiction_authors with the uid 1, and so on.


 
Posted : 15/09/2009 7:06 pm
(@msmelanie1)
Posts: 17
Active Member
Topic starter
 

Sorry, I made that harder than I needed it to be, I just wanted to make sure I didn't miss anything. They are both on the same database, one has a prefix and one does not. My main problem is the duplication entry 1 for key 1 thing.

I don't understand. I have three backup files, each made at different times. None of them were made after my second site was created. I tried on a fresh install without install/install.php so no tables were made. It said there was an error and none of the tables existed? (I thought it was supposed to make the tables??) πŸ˜•

I went and ran the install this time. Now there were already tables, same problem. I emptied the tables, there is nothing there and it still says there is duplicates. I am looking all over inside my backup sql files and I am not finding duplicates of anything. I have stuped to loading little by little and not very much is getting in. Keep in mind this is a new database again.

I just don't get it. Maybe I should just give up on efiction until I learn php and mysql more efficiently. Only thing is I would hate to load up all those stories again. Ugh.


Php 5.2.4| Mysql 5.0.27|Efiction 3.5.1|

 
Posted : 15/09/2009 11:15 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

So, here's a general overview of how to get a site working with a database backup copy:

1. Upload your database (should be an .sql file)
2. Create the database user & password and associate it with the database
3. Upload the contents of the eFiction folder to your directory (you don't need to upload the install folder)
4. Copy config.php out of the docs folder and into the root. Edit it so that the database information is correct (including prefix, if you have one).

I'm assuming you're using the most recent download for the files, which is 3.5.1. If your previous site was not at 3.5.1 when the backup was made, your site should prompt you to run an update upon viewing it. (If not, you can do this in Admin > Archive Maintenance.)

My main problem is the duplication entry 1 for key 1 thing.

The message you posted isn't very helpful as to which one, unfortunately. I suspect you should definitely look at the settings table, and make sure there's only ONE fanfiction_settings, regardless of prefix. The settings table can have a prefix separate from everything else, which might be what is throwing yours off.


 
Posted : 16/09/2009 1:28 am
(@tammy)
Posts: 2577
Member Moderator
 

It's not going to be the settings table.  That table doesn't have any numerical keys. Most likely, it's going to be a table that has an auto increment field like stories or chapters.


 
Posted : 16/09/2009 10:29 am
(@msmelanie1)
Posts: 17
Active Member
Topic starter
 

Thanks Tammy for the suggestion, but even though I found it...I can't do anything. It's hard to explain, but is the text in the chapters  supposed to overlap continuously in chapters in the sql backup? When I highlight it, it all goes away and only one line shows. Strangest thing I've seen. Then when I go in to change a simple number in it the error shows the new number I put in once for three times.

I can't even explain it, you'd have to see it for yourself. Thanks for your help Lyndsie and Tammy, but I don't think I can fix it with my skill level. I only have two backups and the first one was completely corrupted, while the second one has strange duplicates going on. I think I'll just download efiction again and start fresh. It'll be some work, but uploading 28 stories might be easier than understanding anymore. I feel like my brain is going to explode.


Php 5.2.4| Mysql 5.0.27|Efiction 3.5.1|

 
Posted : 16/09/2009 7:49 pm
Share: