Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Import Problems.

Quote Reply
Import Problems.
I tried to import another site into the new links.

I set up a clean install into the same database as the old links, using the new_ prefix.

I had an extra field in the user record - "Chief_Editor"

I got the error the query failed because "Chief_Editor" was specified twice. (I think I reported this error before).

I deleted the field, and didn't get that error, but then got:

Import error: CRITICAL ERROR OCCURED: Unable to execute query `SELECT ID, Name, Description, Meta_Description, Meta_Keywords, Header, Footer, Number_of_Links, Has_New_Links, Has_Changed_Links, Newest_Link FROM Category ORDER BY Name': Unknown column 'Newest_Link' in 'field list' at Links/Import/S1S2.pm line 454



There seems to be some sort of "off by one" type error going on here.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Import Problems. In reply to
In Reply To:
Import error: CRITICAL ERROR OCCURED: Unable to execute query `SELECT ID, Name, Description, Meta_Description, Meta_Keywords, Header, Footer, Number_of_Links, Has_New_Links, Has_Changed_Links, Newest_Link FROM Category ORDER BY Name': Unknown column 'Newest_Link' in 'field list' at Links/Import/S1S2.pm line 454
This means your table Category which is a Links SQL 1 table did not have the column Newest Link for some reason?

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Import Problems. In reply to
No, it didn't...

It might have gotten "lost" in the various upgrades. It was in one of my older databases. Never caused a problem. But.... it prevented the database import, so maybe some error checking needs to be done.

I'm sure I'm not going to be the only one with a missing field. At least I figured out how to get around it. Not everyone will.

Maybe, just prompt with "You need to add the field 'xyz' to your existing (old/Links 1.x) database in order to complete this import". At least they will know what the problem is.

Just doing a compare of the field tags would check to make sure all required tags exist.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Import Problems. In reply to
Alex,

The following error still persisted in the beta4 . The database was imported this time, but without the "users" table.


Import error: WARNING: Unable to execute query `INSERT INTO Users (Name, Username, Password, Email, Validation, Status, Chief_Editor, Server_Name, Join_Date, Join_Date, Server_Name, Chief_Editor) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' (wwww): Column 'Chief_Editor' specified twice

Import error: WARNING: Unable to execute query `INSERT INTO Users (Name, Username, Password, Email, Validation, Status, Chief_Editor, Server_Name, Join_Date, Join_Date, Server_Name, Chief_Editor) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' (www www): Column 'Chief_Editor' specified twice

etc.....

But looking at the errors, "Join_Date" is specified twice....???

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Import Problems. In reply to
In Reply To:
But looking at the errors, "Join_Date" is specified twice....???
Yes, that's true, but Chief_Editor is there twice as well. I don't know about how mysql goes about determining that a duplicate has been specified, but whatever scheme is uses is detecting Chief_Editor before Join_Date. The only way that I could see this error happening (and in fact the only way that I am able to reproduce it) is to have multiple entries for a column specified in the .def files. Is this the case for you?

I've fixed the Links SQL 1 import so that it will now ignore duplicate columns in the def file, which should allow an import from a def file that actually DOES contain any number of duplicates.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: Import Problems. In reply to
I'll check... but I regenerate the def files automatically now, not by hand.

Here is my definition:

In Reply To:
%db_def = (
Username => ['1', 'CHAR', '25', '25', '1', '', '', ''],
Password => ['2', 'CHAR', '25', '25', '1', '', '', ''],
Email => ['3', 'CHAR', '40', '50', '0', '', '', ''],
Validation => ['4', 'CHAR', '20', '20', '0', '', '', ''],
Status => ['5', 'CHAR', '0', '13', '1', 'Not Validated', 'Not Validated|Registered|Editor|Administrator', ''],
Chief_Editor => ['6', 'TINYINT', '10', '20', '0', '0', '', ''],
Server_Name => ['7', 'CHAR', '40', '65', '0', '', '0', '0'],
Join_Date => ['8', 'DATETIME', '20', '20', '0', '', '0', '0']
);
Now, the caveat _is_ my Users table is in a different database -- ie: Users. I think you had addressed this previously, to allow for that. Could the error be in that routine?

Here's the database structure:

CREATE TABLE Users (
Username varchar(25) DEFAULT '' NOT NULL ,
Password varchar(25) binary DEFAULT '' NOT NULL ,
Email varchar(50) ,
Validation varchar(20) ,
Status enum('Not Validated','Registered','Editor','Administrator') DEFAULT 'Not Validated' NOT NULL ,
Chief_Editor tinyint(1) ,
Server_Name varchar(65) ,
Join_Date timestamp(14) ,
PRIMARY KEY (Username),
KEY sndx (Status)
);


Which matches the def.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Import Problems. In reply to
Ah, it was a problem with a loop being before another one, and it only affected the Users table (not Links or Categories or Validate). Anyway, it's been fixed for the next release.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: Import Problems. In reply to
I had that problem recently... but ... never mind <G>

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ