Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Import does not work v1.1 to 2.0.5 of default installations!!!

Quote Reply
Import does not work v1.1 to 2.0.5 of default installations!!!
Hello!

I have tried to import a fresh default installation data from Links v 1.1 tables to v2.0.5 default tables. Hence there are no custom fields in the two.

This gives an error. It says

Importing Subscribed users (users who receive the newsletter) ...
0 Subscribed users imported.
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 /XXX/admin/Links/Import/S1S2.pm line 485

Regardless of which option is choosen, the error remains the same. It does find the installation of 1.1 correct and all the defs files are correctly sync. in both the versions.

Where can be this problem?

Did anyone have this problem? I have now invested about 35 - 40 hours in playing after which I found out that the default installation of the two default installation does not work.

Ofcourse I have inserted couple of categories and links in the v1.1!!!


Last edited by:

rajani: Dec 2, 2001, 8:33 AM
Quote Reply
Re: [rajani] Import does not work v1.1 to 2.0.5 of default installations!!! In reply to
Hello Alex!

Ack, this is a bug.

Remove the field name "Newest_Link" from line 331 from S1S2.pm!

After removing this the import went fine.

It could be that the default installation I have not did create this field in the v1.1! So could be that the field was added as a system field in the later versions.
Quote Reply
Re: [rajani] Import does not work v1.1 to 2.0.5 of default installations!!! In reply to
Hello!

I realised that there were many changes in the database fields. So I has to go through an upgrade script 1.0 to 1.11 and it did create the necessary fields and drop some tables.

However now I have anathor problem!! Quite troublesome to import, or atleast setup.

Importing Subscribed users (users who receive the newsletter) ...
0 Subscribed users imported.

Importing Categories and Links ...
A fatal error has occured:
execute called with 12 bind variables when 13 are needed at /XXX/admin/Links/Import/S1S2.pm line 612.

Please enable debugging in setup for more details.


Stack Trace
======================================
Links (8963): Links::environment called at /XXX2/admin/Links.pm line 487 with no arguments.
Links (8963): Links::fatal called at /XXX2/admin/Links/Import/S1S2.pm line 612 with arguments
(execute called with 12 bind variables when 13 are needed at /XXX2/admin/Links/Import/S1S2.pm line 612.
).
Links (8963): Links::Import::S1S2::import called at /XXX2/admin/nph-import.cgi line 207 with arguments
(HASH(0x81006f4), CODE(0x82e2d98), CODE(0x82e2e40), CODE(0x82e2ce4)).
Links (8963): main::do_import called at /XXX2/admin/nph-import.cgi line 141 with arguments
(clear_tables, 1, Interface_CGI, 1, straight_import, 1, error_file, STDOUT, destination, /XXX2/admin/defs, source, /XXX1/admin/defs, transfer, S1S2).
Links (8963): main::main called at /XXX2/admin/nph-import.cgi line 26 with no arguments.

Last edited by:

rajani: Dec 2, 2001, 9:54 AM
Quote Reply
Re: [rajani] Import does not work v1.1 to 2.0.5 of default installations!!! In reply to
Hi,

Yes, the import script can't handle Links SQL 1.0x unfortunately. I didn't think anyone was still using that! It requires 1.1x to work.

Once you upgraded to 1.1, did you remove any changes you made to the S1S2.pm file? If you still were missing the Newest_Link column in the code, it would cause this error.

Cheres,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Import does not work v1.1 to 2.0.5 of default installations!!! In reply to
Hello Alex!

I ofcourse do not use 1.0 fortunately, but wanna setup a system to import links keeping category the same. There are about 60.000+ links and 300+ categories. The files is 40Megs+! I cannot send you.

I have the links exported with category information in access and its no problem to import them back to 1.11 tables step by step, the editor.cgi does this very good.

However, I need to do it in batches of about 500 links. It crashes due to busy server. After import I can empty the table and reload with anathor batch. Hence I need a seperate setup for a while to get imports working.

I did redo the changes to the module and now everything is default, including the modules, scripts, tables, defs, re-sync. etc. But it still gives this error with all options.

The error is in the S1S2.pm in the following lines:

else {
(612) unless ($cat_ins_sth->execute($new_id,$name,$father_id,$full_name,@$row)) {
--$Category_counter unless $$opt{straight_import};
warning("Unable to insert category `$full_name' (SQL query: `INSERT INTO ${e_prefix}Category $cat_ins_cols VALUES $cat_ins_vals'): ".$cat_ins_sth->errstr);
next;
}

Last edited by:

rajani: Dec 2, 2001, 11:30 AM
Quote Reply
Re: [Alex] Import does not work v1.1 to 2.0.5 of default installations!!! In reply to
Hello Alex!

Yes, you were right. In my computer it was correct but not on the net! The module was missing the Newest_links in the line. Now I have uploaded the "Original" module and it should be fine.

However, it gives the error that is in my fist message, i.e. line 485 error. It is as below:

$cat_sth->execute() or critical("Unable to execute query `SELECT $cat_get_cols FROM $Links::DBSQL::Category::db_table ORDER BY Name': ".$cat_sth->errstr);

The error is as below:

Importing Subscribed users (users who receive the newsletter) ...
Import error: WARNING: Unable to set Newsletter = 'Yes' for user with e-mail user@user.com:
You have an error in your SQL syntax near '= 'Yes', Newsletter = 'Yes' WHERE Email = 'user@user.com'' at line 1, admin/Links/Import/S1S2.pm line 316
0
0 Subscribed users imported.
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 /XXX/admin/Links/Import/S1S2.pm line 485

Would be thankful for your help.

Last edited by:

rajani: Dec 2, 2001, 11:50 AM
Quote Reply
Re: [rajani] Import does not work v1.1 to 2.0.5 of default installations!!! In reply to
Hello Alex!

Now I have tried several times to use the default installation but it givs the same error. There has been no changes in any module or anywhere at all.

Can you please help?

Thanks.
Quote Reply
Re: [rajani] Import does not work v1.1 to 2.0.5 of default installations!!! In reply to
Make sure you have the Newest_Link column in your table. You bypassed that a few messages above. The error is pretty clear what is happening:

"...Unknown column 'Newest_Link' in 'field list' at /XXX/admin/Links/Import/S1S2.pm line 485"

Conversely, make sure you are not trying to select that from your old database! If so, add that column to the old table, and try. I had to do some "funny" things when I upgraded originally (before my crash), and one of them was adding or removing columns from tables during an import. Because this only happens once, and my databases were so customized, I only reported what I thought were "general" problems.

BTW... the imports use the .def files, so make sure your .def files _MATCH_ your databases tables!!



PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.

Last edited by:

pugdog: Dec 5, 2001, 8:43 AM
Quote Reply
Re: [rajani] Import does not work v1.1 to 2.0.5 of default installations!!! In reply to
Can you do an sqldump of your 1.x data and email it to me so I can try it here?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [pugdog] Import does not work v1.1 to 2.0.5 of default installations!!! In reply to
In Reply To:
Make sure you have the Newest_Link column in your table. You bypassed that a few messages above. The error is pretty clear what is happening:

"...Unknown column 'Newest_Link' in 'field list' at /XXX/admin/Links/Import/S1S2.pm line 485"

The error is also clear and the debugging helped me a lot.

Thats the reason why I was able to trace a lot of things even before I placed a message here. Alex has developed so terrific routines here that I sometimes do not even know how to appriciate!!!

What I do not understand is why the hell it says this! It is there in the old and the new, and actually thats the default installation. I even checked the sequence of the columns, in the programming, defs, and tables of both ( !!! ), thinking that it thats the reason why it appears.

I was truely fed up before I placed the message. Once again, now I am will try to setup anathor completely different and new adventure to setup a new database and tables, setting up directly from there as default.

In Reply To:
Conversely, make sure you are not trying to select that from your old database! If so, add that column to the old table, and try. I had to do some "funny" things when I upgraded originally (before my crash), and one of them was adding or removing columns from tables during an import. Because this only happens once, and my databases were so customized, I only reported what I thought were "general" problems.

Oh NO! that cannot be the reason because the database servers are different!

BTW, soorry to learn about your crash! I have seen the nightmares you are facing in the recent months. Hope that you get out of it and the very best wishes.

In Reply To:
BTW... the imports use the .def files, so make sure your .def files _MATCH_ your databases tables!!

Not true again.

I have learnt that before I ever ever do anything I simply go to re-sync. function of both old and new. I have always done it without any exception. So this part is also out of question.

But by the way, thanks again for the tips.



Quote Reply
Re: [Alex] Import does not work v1.1 to 2.0.5 of default installations!!! In reply to
In Reply To:
Can you do an sqldump of your 1.x data and email it to me so I can try it here?

Cheers,

Alex

In the dump there is going to be one line of a category which is having Europe as a category. In the links table there is one link having my name as a URL in the appropriate definition as full URL. Thats all!

Thats my default installation!!

I do not think there is something in there.

I however plan to send you all the scripts that I am having for the default.

Or actually the best would be to send you togather with it, the defs of the final one also.

I think the best result would be to tweak the import and add system fields in the exact manner how they should be inserted corresponding to the defs and field sequences. This would yield the best result. I shall send this as an attachment to you today.

I hope to have something live by the end of this year.
Quote Reply
Re: [Alex] Import does not work v1.1 to 2.0.5 of default installations!!! In reply to
Hello Alex!

There seemed to be problems in the earlier installation somewhere that I could not figure it out. So I deleted the entire instllation and then made sure that there is everything in default.

It then works. The import has been possible from the two default installation.

But there has been a couple of new issues coming on the surface. They do seem to be a situation of the script itself. Hence I would prefer to address into a new thread.

So I shall not send you an email, because the new one is working. (What a horror Man, I tell you, I HATE Perl!)