URL to your eFiction: http://www.sinful-desire.org/archive2/ - this is an exact replica of my real archive, because I wanted to test it out first. My real archive is http://www.sinful-desire.org/archive/
Version of eFiction: 2.0.7
Have you bridged eFiction, if so with what?: No?
Version of PHP: 4.1.21
Version of MySQL: 4.1.10
Have you searched for your problem: Yes
If so, what terms did you try: Upgrading, 2.0.7, mysql error, 1050 error
State the nature of your problem: I tried to explain the best I could below.
Do you have a test account for us? No, but the real archive as a test pw: test, even though I don't think that would help.
I wanted to give the upgrade a test run before trying it live, so I uploaded a copy of my entire archive into a new folder to try it out before I did it for real.
I get to what I believe is step 4 and it asks me to install tables. and I say that I want to install them automatically. When I choose that, this is what comes up:
A fatal MySQL error was encountered.
Query: CREATE TABLE `fanfiction_authorfields` ( `field_id` int(11) NOT NULL AUTO_INCREMENT, `field_type` tinyint(4) NOT NULL default '0', `field_name` varchar(30) NOT NULL default ' ', `field_title` varchar(255) NOT NULL default ' ', `field_options` text, `field_code_in` text, `field_code_out` text, `field_on` tinyint(1) NOT NULL default '0', PRIMARY KEY (`field_id`) ) TYPE=MyISAM;
Error: (1050) Table 'fanfiction_authorfields' already exists
I tried what another thread suggested - I went to the tables.sql file in the "docs" folder and I added a prefix to all of the tables. It sorta worked that time but none of the authors and stories showed up when I got to the empty archive. And I'm upgrading, I want to keep all of my authors and reviews, etc. so I didn't think that would work.
Then I started over back at 2.0.7 and tried to bypass all of the tables prefixes because it just wouldn't let me get through that part, but I was stopped at step 8 with the Message Data:
A fatal MySQL error was encountered.
Query: INSERT INTO `fanfiction_messages` (`message_name`, `message_title`, `message_text`) VALUES ('', '', '');
Error: (1146) Table 'sinfulde_archive.fanfiction_messages' doesn't exist
So I am just confused and completely stuck. I spent over 4 hours trying to upgrade to the new version with no success. I would really like to upgrade to 3.2 because I played around with it and it's a wonderful upgrade, but I have 400 members and 1000 stories that I don't want to lose.
Thank you in advance you guys!
URL: http://www.sinful-desire.org/archive
Version: 3.5.2
Modules: Story End, Beta Reader, Challenges, Story Tracker
PHP: 5.2.5
MySQL: 5.0.67
Your first error is because the table the upgrade script is trying to create already exists. You're probably going to have to install the tables from step 4 manually so that you can skip the statements that are trying to create tables that already exist and not hang up the install. You're getting the second error because when you started fresh, and skipped the table prefixes, the table that threw the error wasn't created, so step 8 can't find it to insert data into it. Make sense? From your post I suspect you may have read this thread in your search for a solution:
https://efiction.org/forums/index.php?topic=4983.msg27035#msg27035
If not, I'll repost where and how to do that just to make it easy:
This will take care of step 4 in knowing that it was definately successful.
The sql files that you would use to run the statements manually are located in the docs folder. You'll see one called upgrade20_step4.sql.
Steps:
Access phpMyAdmin
There should be a tab that says SQL, click that
You'll see a box.
Open the upgrade20_step4.sql in a text editor like notepad
Add your table prefix in front of each table name. So for fanfiction_stories, it should be sinfulde_archive.fanfiction_stories
Copy/paste the first statement into that box, click go. Do this one at a time for each statement.
If you get an error that states the table already exists, then that means the table is already created, [each statement in that file is a CREATE statement to create the additional tables for version 3.0+]. You don't have to worry about it [hence why I say do each one one at a time]. If you get a different error, post it and we'll see if we can't get you sorted. Shouldn't have any issue with the syntax..but you never know π If you don't get any error beyond table exists, you should be golden to go to step 8
Now to see if you can perform step 8, put this in your browser :
http://www.sinful-desire.org/archive2/install/upgrade20.php?step=8
You should be able to continue with the install. If you get another error, just post it and we'll see if we can't get you straightened out. You may run into error stating duplicates if you didn't delete the test DB totally when you started fresh. From the 1st error, I suspect that to be the case. But it's nothing that can't be fixed. π
Kudos for duplicating your archive and doing a test run.
Wow! Thanks for getting back to me with such a great, detailed response. That actually wasn't the thread I had read, so I'm glad you included it.
I'm working on part 1 of the problem and am at the box where I type everything in and add the prefixes. I've copied my database to a different name so I don't get confused from the real one, so my prefix is now sinfulde_testing.
I copy the following in:
-- --------------------------------------------------------
--
-- Table structure for table `sinfulde_testing.fanfiction_authorfields`
--
CREATE TABLE `sinfulde_testing.fanfiction_authorfields` (
`field_id` int(11) NOT NULL auto_increment,
`field_type` tinyint(4) NOT NULL default '0',
`field_name` varchar(30) NOT NULL default ' ',
`field_title` varchar(255) NOT NULL default ' ',
`field_options` text,
`field_code_in` text,
`field_code_out` text,
`field_on` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`field_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
-- --------------------------------------------------------
And then MySQL said:
#1103 - Incorrect table name 'sinfulde_testing.fanfiction_authorfields'
I don't know what I'm doing wrong, but clearly something! The inner workings of SQL databases are very new to me!
URL: http://www.sinful-desire.org/archive
Version: 3.5.2
Modules: Story End, Beta Reader, Challenges, Story Tracker
PHP: 5.2.5
MySQL: 5.0.67
No period. If your prefix is 'sinfulde_testing' then the table would be 'sinfulde_testingfanfiction_authorfields'
OK, so I went through and added the tables manually and got up to Step 19, Optimize Database
This step will optimize the database through the removal of some indexes on the tables and the addition of a number of new ones. How do you want to optimize the database?
I select automatic, like I had done with everything else, and this comes up:
A fatal MySQL error was encountered.
Query: alter table fanfiction_categories drop index category;
Error: (1091) Can't DROP 'category'; check that column/key exists
And I'm apparently missing a fanfiction.stats table? I haven't seen that anywhere!
(OMG all of this makes me want to cry from frustration)
URL: http://www.sinful-desire.org/archive
Version: 3.5.2
Modules: Story End, Beta Reader, Challenges, Story Tracker
PHP: 5.2.5
MySQL: 5.0.67
I wasn't sure if having a period in the prefix would make mySQL cranky..now I know for future reference /doh! π
Just breathe. It's all a learning experience. We all had to start somewhere mucking our way through upgrades, installs, mods, etc. And you also are doing an upgrade on a duplicate..so there's no pressure to get this right asap as your live site is still working. You're doing fine.
Your fanfiction_stats error:
Looks like that statement wasn't in the sql file, but the upgrade script does create it. The solution is the same as doing step 4 manually, you just need to paste two statements into your SQL part of phpMyAdmin:
CREATE TABLE `sinfulde_testingfanfiction_stats` (
`sitekey` varchar(50) NOT NULL default '0',
`stories` int(11) NOT NULL default '0',
`chapters` int(11) NOT NULL default '0',
`series` int(11) NOT NULL default '0',
`reviews` int(11) NOT NULL default '0',
`wordcount` int(11) NOT NULL default '0',
`authors` int(11) NOT NULL default '0',
`members` int(11) NOT NULL default '0',
`reviewers` int(11) NOT NULL default '0',
`newestmember` int(11) NOT NULL default '0'
) TYPE=MyISAM;
INSERT INTO sinfulde_testingfanfiction_stats(`sitekey`, `newestmember`) VALUES('$sitekey', '1');
Hopefully the syntax is right, I copied that from the script, so I could have missed a quote. This should create that table and insert the data
Onto your step 19 error:
Basically what's happening is the upgrade script is trying to alter the table by deleting something that it can't find. Much like your earlier error when the script was trying to insert data into a table that didn't exist. Fortunately, this step also can be done manually where you can run each statement one by one and you won't get hung up. First though, take a look at your fanfiction_categories table and verify what data is and isn't there.
Steps:
Access phpMyAdmin
Click on your fanfiction_categories table
You should see an area that says Indexes in the lower left side of the screen
I'm suspecting that this table is already optimized because it can't find an index to drop [hence the error]. Just verify that that is the case and you don't see something called category in the column with the field heading. If it's not there, it's ok, because it's supposed to go when you upgrade.
Now, onto doing the DB optimization manually. Much like step 4, you'll be copy/pasting statements one at a time. The file that has the statements is called optimize.sql and is in the docs folder just like the upgrade20_step4.sql file was
Steps:
Access phpMyAdmin
Click the tab for SQL
You'll see a box.
Open the optimize.sql file in a text editor like notepad
Add your table prefix in front of each table name. So for fanfiction_authorinfo, it should be sinfulde_testingfanfiction_authorinfo
Copy/paste the first statement into that box, click go. Do this one at a time for each statement.
Make a note of the errors you get, so you can look at the table in question and verify any missing data is not there for statements that are dropping [aka deleting] information. Also make note of errors for things being altered. Chances are the table's already altered, and since mySQL is new to you, you may not know how to double check. So post what you have and we can help you sort through that. [Shouldn't be an issue since you didn't get past the first query, but just in case]
Now from this, looking at the upgrade script, I'm not 100% certain so perhaps Tammy, Carrissa, Jan_AQ et al can clarify.. it looks like a part of step 19 does some updating in addition to the sql statements in the sql file. What I would do [and I tend to do things the hard way first, so you may want to wait for another suggestion :P] is to alter the upgrade20.php to take out the optimizing queries and run step 19. I can detail that below if you want to try it.
Steps:
Make a copy of upgrade20.php [this will be your backup copy in case my suggestion doesn't quite work out. Backups are good, backups are wise :lol:]
Open upgrade20.php in a editor like notepad
Find the code that says:
case "19":
Then look for lines that follow after it that says
if(isset($_GET['install'])) {
if($_GET['install'] == "automatic") {
dbquery("alter table ".$tableprefix."fanfiction_categories drop index category;");
dbquery("alter table ".$tableprefix."fanfiction_categories drop index parentcatid;");
dbquery("create index byparent on ".$tableprefix."fanfiction_categories (parentcatid,displayorder);");
dbquery("create index forstoryblock on ".$tableprefix."fanfiction_chapters (sid,validated);");
dbquery("alter table ".$tableprefix."fanfiction_comments drop index nid;");
dbquery("alter table ".$tableprefix."fanfiction_comments add index commentlist (nid,time);");
dbquery("alter table ".$tableprefix."fanfiction_inseries drop index seriesid;");
dbquery("alter table ".$tableprefix."fanfiction_inseries drop index inorder;");
dbquery("alter table ".$tableprefix."fanfiction_inseries add index (seriesid,inorder);");
dbquery("alter table ".$tableprefix."fanfiction_inseries drop index sid;");
dbquery("alter table ".$tableprefix."fanfiction_inseries add primary key (sid,seriesid);");
dbquery("create index avgrating on ".$tableprefix."fanfiction_reviews(type,item,rating);");
dbquery("alter table ".$tableprefix."fanfiction_reviews drop index sid;");
dbquery("create index bychapter on ".$tableprefix."fanfiction_reviews (chapid,rating);");
dbquery("alter table ".$tableprefix."fanfiction_reviews add index byuid (uid,item,type);");
dbquery("alter table ".$tableprefix."fanfiction_series drop index owner;");
dbquery("create index owner on ".$tableprefix."fanfiction_series (uid,title);");
dbquery("alter table ".$tableprefix."fanfiction_stories drop index validated;");
dbquery("create index validateduid on ".$tableprefix."fanfiction_stories (validated,uid);");
dbquery("create index recent on ".$tableprefix."fanfiction_stories (updated,validated);");
dbquery("ALTER TABLE `".$tableprefix."fanfiction_inseries` DROP `updated`");
dbquery("ALTER TABLE `".$tableprefix."fanfiction_news` ADD `comments` INT NOT NULL DEFAULT '0'");
dbquery("ALTER TABLE `".$tableprefix."fanfiction_series` ADD `numstories` INT NOT NULL DEFAULT '0'");
$serieslist = dbquery("SELECT seriesid FROM ".$tableprefix."fanfiction_series");
You want to take out all the lines that start with dbquery since these are the statements you have just run manually. When you're done that section should look like this:
if(isset($_GET['install'])) {
if($_GET['install'] == "automatic") {
$serieslist = dbquery("SELECT seriesid FROM ".$tableprefix."fanfiction_series");
That should be all you have to change. Save the file, upload it to your server overwriting the copy that's already there. Then in your browser, put in this URL:
http://www.sinful-desire.org/archive2/install/upgrade20.php?step=19
and see if you can't finish the install
OK, thank you for the fanfiction_stats coding!
And before I get to step 19, I'm a step 10 that asks this: Update Stories and Series Tables. This step will create the classes column in your stories and series tables. How do you want to proceed?
If I do automatic it comes up with this:
A fatal MySQL error was encountered.
Query: ALTER TABLE fanfiction_stories ADD `classes` VARCHAR( 200 ) NULL AFTER `catid`;
Error: (1060) Duplicate column name 'classes'
I opened the upgrade20_step10.php file in /docs to try and do it manually but haha, I read the first line And I'm already confused!:
ALTER TABLE fanfiction_stories ADD `classes` VARCHAR( 200 ) NULL AFTER `catid`;
Thank you SO much for coming back to help me with this! I reall do appreciate it.
Oh! And I went ahead and looked at the fanfiction_categories table and I believe this is a category in the column with the field heading - do I need to get rid of that before I get to step 19?
URL: http://www.sinful-desire.org/archive
Version: 3.5.2
Modules: Story End, Beta Reader, Challenges, Story Tracker
PHP: 5.2.5
MySQL: 5.0.67
Not a problem.
Question: are you trying the solutions, and then going through the install from that point onward?
I ask because you're getting that error at step 10 most likely because that step was already done [you got to step 19 before you got halted by errors]. That's why you're getting an error stating duplicates. If you look at the table in your database, you more than likely have classes there.
For the manual sql file..it's the same as you been doing. The ALTER statement is a command to mySQL to change a table in some way. In this case, that particular statement is altering your stories table by adding a field to it to store information in named classes. If you want to verify that step 10 was done correctly, you would follow the same steps as the others with opening up the sql file [as you did] , putting your prefix in front of the table name and copy/pasting each statement one by one. If you get errors stating duplicates, this means the table's been altered already and you can verify by looking at the tables.
I'm going to assume that this is the case [cause I can't see your DB naturally ;)] since you're getting that error. That's the first thing I'd look for to see if it already took. Also, silly question, but it will save some trouble and frustration on your part. The duplicate database you're working with...is the prefix of the tables of the DB sinfulde_testing or are they sinfulde_archive. I know you said you changed the prefix to steer away from confusion. Been awhile since I ran an upgrade, but you're asked for a table prefix for your settings table if you want it different from the prefix you use for the rest. After that, it checks for your dbconfig file and pulls your information from there if it exists. Did you change the prefix there when the script presented your archive settings? I ask cause I'm kinda suspecting the script is looking for table names that aren't correct.
As far as what you're seeing in your categories table..that's how it should be prior to the upgrade. You don't need to do anything until you do the optimization manually as I outlined in my previous post. Since the item the statement is looking for to drop is there [as shown by the pic in your post], if you get the same error, I'd suggest making sure that the table names match. ie. that that table is really called sinfulde_testingfanfiction_categories. This is why I asked about your table prefix in the paragraph above. Try the solution for step 19 in my previous post and let's see where that leaves you. When you run the install script..start at step 19 using that URL I posted in my reply after you've modified the upgrade file as I detailed [unless someone chimes in with an easier solution to get through step 19]:
http://www.sinful-desire.org/archive2/install/upgrade20.php?step=19
OK, I went through and did everything like you explained in your first response, and when I selected "return to your site" this is what came up:
A fatal MySQL error was encountered.
Query: SELECT nid, author, title, story, UNIX_TIMESTAMP(time) as date, comments FROM fanfiction_news ORDER BY time DESC LIMIT 1
Error: (1054) Unknown column 'comments' in 'field list'
URL: http://www.sinful-desire.org/archive
Version: 3.5.2
Modules: Story End, Beta Reader, Challenges, Story Tracker
PHP: 5.2.5
MySQL: 5.0.67
It looks like an ALTER statement in the upgrade script isn't in the optimize.sql
Try running this statement and see if that doesn't make it happy:
ALTER TABLE sinfulde_testingfanfiction_news ADD comments INT NOT NULL DEFAULT 0
I -hope- that syntax is right.
AH HA! The archive came up! *cheers and dances* THANK YOU!
And two things before I am going to try this on my real archive -
1. Should the site info, that gives stats on how many stories, authors, etc. be up to date? I don't have any numbers listed over there. I did recalculate site statistics in the archive maintenence section but that didn't change anything.
And in the admin -settings - site settings section, I wanted to turn on the "Display debug information" because I read that was helpful in detecting and problems, and this came up a bunch of times at the tops of the layouts:
Notice: Undefined index: link_key in /home/sinfulde/public_html/archive2/includes/pagesetup.php on line 84
Thank you again!
URL: http://www.sinful-desire.org/archive
Version: 3.5.2
Modules: Story End, Beta Reader, Challenges, Story Tracker
PHP: 5.2.5
MySQL: 5.0.67
Most welcome π
If these suggestions don't work, post a new thread for each problem if a search doesn't help you out.
1. Yeah it should. But this starts to wade into skin territory sorta. Blocks can be controlled via variables.php in the skins folder. If something doesn't show, go to Admin > blocks, in this case, your site info block, click options and change what's there. More than likely it's a setting in variables.php
The skin section has a section called Info and Tutorials that will have more information about variables.php and skins. Here's a link Tammy provided to an article she wrote up on variables.php so you can understand what you're looking at when you open variables.php in an editor like notebook. Also, you have the option that if you want the look of your site controlled solely by the admin panel, you can delete variables.php totally.
http://efiction.hugosnebula.com/readarticle.php?article_id=4
2. Turn debug off..that will most likely clear that up. When you have an issue, turning it on is helpful when you give a link for your site...helps people figure out what may be going on.
Also, before you try this on your live site, since you had a couple problems, I'd suggest deleting your test DB and delete all the files for your test site. Upload a copy of your live site and a copy of your live site's DB and try to run the upgrade with no snags.
I uploaded the exact copy of my live archive to a new folder and new database and it worked perfectly!! It's a hassle to do all that manually but I'll do it to get the upgrade to work! THANK YOU.
However, I still ran into the same problem where the site info stats are empty. I posted a thread in the Skins section, but I think it has something to do with the fanfiction_stats sql file and it says "No Index Defined!" I think this is where the issue is?
Thank you for all the help!
URL: http://www.sinful-desire.org/archive
Version: 3.5.2
Modules: Story End, Beta Reader, Challenges, Story Tracker
PHP: 5.2.5
MySQL: 5.0.67
Glad I could help out.
I wish I had other ideas on the _stats problem, but I don't. π
I am looking at my stats table now, and mine says no index defined as well, and it is working fine, on both my sites.
Indexes: No index defined!
Create an index on columns
Space usageType Usage
Data 52 B
Index 1,024 B
Total 1,076 B
so this is perhaps not your issue
why is nothing ever easy?
url: http://www.pretendercentre.com/missingpieces/
php: 5.2.5 msql: 5.0.45-community
efic version: 3.4.3 latest patches: yes
bridges: none mods: challenges, displayword, beta-search