Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Import data Links 2.0 into Links sql

Quote Reply
Import data Links 2.0 into Links sql
Tried to import my links 2.0 text-database into Links SQL. It fails on the date format. In my links 2.0 database all dates are d-m-yyy and links sql expects yyyy-mm-dd.

What can I do to import my 'old' database.
Quote Reply
Re: [Frest] Import data Links 2.0 into Links sql In reply to
How many links do you have in your Links2 database? That will decide if you need to run a script to update these dates, or if it will be easier to edit your .db file manually :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Frest] Import data Links 2.0 into Links sql In reply to
I've had the same problem and change
something in gossamers import script:

L2S2.pm in folder /cgi-bin/admin/links/import

You have to change something behind line 791
(Backup the original pm before you code it)

Best regards from
Bremen/Germany

Lothar
Quote Reply
Re: [eljot] Import data Links 2.0 into Links sql In reply to
Thanks Andy,

There are 1125 links in the database. And I already changed them 'by hand'. Well, I changed them in MS Access and gave them the format yyyy-mm-dd(text). But again I got this message:
======================
Import error: WARNING: Invalid date `2004-01-01' encountered.
Import error: WARNING: Invalid date for link with ID 133. Link skipped.
=======================

So I think something is very wrong...

And thanks Lothar. I've read another thread in this forum about that solution(?). But now I tried it in my own way, I'm not sure what to do.

Is there a way to just skip the import of the date? I don't really need them.
Quote Reply
Re: [Frest] Import data Links 2.0 into Links sql In reply to
Hi, in admin/Links/Import/L2S2.pm , on about line 800, find;

Code:
if ($year and $months{$mon} and $day) {
return sprintf("%04d-$months{$mon}-%02d", $year, $day);
} else {
warning "Invalid date `$in' encountered.";
return;
}


... and change to;

Code:
if ($year and $months{$mon} and $day) {
return sprintf("%04d-$months{$mon}-%02d", $year, $day);
} else {
#warning "Invalid date `$in' encountered. Setting to 2004-10-10";
return '2004-10-10';
}

Make sure you have a backup before you make this change.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Import data Links 2.0 into Links sql In reply to
Doesn't work Andy.

===========================
Import error: WARNING: Invalid date for link with ID 1. Link skipped.
===========================

Frown
Quote Reply
Re: [Frest] Import data Links 2.0 into Links sql In reply to
Odd. What do you have set in Setup > Date ???

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Import data Links 2.0 into Links sql In reply to
In Setup|Date >> %yyyy%-%mm%-%dd% (date_db_format). This is the default setting.
Quote Reply
Re: [Frest] Import data Links 2.0 into Links sql In reply to
Are you definate you commented this line out?

Code:
warning "Invalid date `$in' encountered.";

???

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Import data Links 2.0 into Links sql In reply to
Yes,

I did a 'copy - paste' Smile
Quote Reply
Re: [Frest] Import data Links 2.0 into Links sql In reply to
Afraid I'm stumped then :(

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Import data Links 2.0 into Links sql In reply to
Ok Andy,

Thanks anyway. I did a lot of hacking in this database. I probably made some stupid mistake somewhere.

I'm now planning to retype the lot.Unsure
Quote Reply
Re: [Frest] Import data Links 2.0 into Links sql In reply to
Do you have the original fields in links sql or do you change something,
add new fields or change the order?

Do you use May, Oct, Dec or Mai, Okt, Dez?

What else is different to normal Links 2 installation?

Do you have activated debug_level with 1 in admin section of Links Sql?

Which Links sql version do you use, english?

Best regards from
Bremen/Germany

Lothar
Quote Reply
Re: [eljot] Import data Links 2.0 into Links sql In reply to
Hi Lothar,

I changed all the fields in de Setup|Date and translated them to Dutch (mei, jun,dec). I use the Englishe version of Links SQL and I did not activate the debug_mode. I did not change the field date_db_format!

I did not change much in the Links 2 installation. I added some fields to the links-table.
What I did with the database was: I imported it in a MS Access database; fooled around with it and exported it back again (as text).

In the mean time I have tried every thinkable date-format and nothing worked. Next try is a direct import trough phpMyAdmin.

greetings from
Den Bommel/the Netherlands

Fred.
Quote Reply
Re: [Frest] Import data Links 2.0 into Links sql In reply to
In Reply To:
I changed all the fields in de Setup|Date and translated them to Dutch (mei, jun,dec). I use the Englishe version of Links SQL and I did not activate the debug_mode. I did not change the field date_db_format!

# $months{Okt} = "10";
# $months{Mai} = "05";
# $months{Dez} = "12";

You must change the language for each month which is in short form not
the same in dutch and english by the example above

Possible that you get more information when you activate the debug mode.

Best regards from
Bremen/Germany

Lothar
Quote Reply
Re: [eljot] Import data Links 2.0 into Links sql In reply to
I changed all dateformats and that part is working fine. But why do you think this formatting has something to do with the importing-problems I have?

Changing the debug mode don't give me extra information.Unsure
Quote Reply
Re: [Frest] Import data Links 2.0 into Links sql In reply to
This is written in den .pm
The import script is based on english language

Best regards from
Bremen/Germany

Lothar