Gossamer Forum
Home : Products : Gossamer Links : Discussions :

nph-import.cgi

Quote Reply
nph-import.cgi
Ok, I had a look at the 'in-built' help file (by just typing perl nph-build.cgi in SSH), it gave me quite a few good pointers, but not quite the one i was looking for. Basically, what I would like to know is; can a start ID be set for the import? The reason I am asking this is because if you want to update an existing database and add new ones, nph-import.cgi aparantly does not take into consideration the start IDs (to stop confusion: It works fine on an import on the same server with links already existing, but I am refering to a SQL dump which will be used on a server that already has links in the database).

Ok, maybe I've confused everyone Tongue If so, just tell me and I'll try to explain a bit better (wow, what a great start to 2002 Wink)

Thanks

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: [AndyNewby] nph-import.cgi In reply to
I'm confused. Do you have a specific example? The ID field is autogenerated, unless you spcifically request an "update". I think if you try to insert a record with an ID that already exists, it simply generates the next available record, rather than generating an error, but I could be wrong. The correct way is to simply leave the ID field blank, and let MySQL pick th enext one. if you are trying to UPDATE records, the ID is used to locate the existing record, then update it (the ID doesn't change).




PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] nph-import.cgi In reply to
Ok, at the moment I am using;

perl nph-import.cgi --import=RDF--source=/home/host/content.rdf.u8--destination=/home/host/public_html/directory/cgi/admin/defs--rdf-category="Top/Adult" --rdf-add-date="2001-01-01"

However, if I already have say 1,000 links in my directory on a sharedserver, and I want to do the dump from DMOZ on my dedicated server (cos myshared account doesnt have enough resources), and then do an upload of the dataonto my shared host from the dump made by nph-import.cgi on my dedicatedserver, how can i set a start ID?

For example, could i use something like;

perl nph-import.cgi --import=RDF--source=/home/ace-host.com/content.rdf.u8--destination=/home/ace-host.com/public_html/directory/cgi/admin/defs--rdf-category="Top/Adult" --rdf-add-date="2001-01-01"--start-id="1001"

I doubt very much that exact extra bit would work, but I'm just trying toexplain what I'm trying to do Tongue

Any more ideas?

Thanks loads.

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: [AndyNewby] nph-import.cgi In reply to
How about dumping the data on your shared server, emptying the database, importing the dmoz data, importing the original data into a second database then doing:

UPDATE Links SET ID = ID + 5000 (for example)

Then re-importing it back into the other database.


Quote Reply
Re: [RedRum] nph-import.cgi In reply to
Good idea. Never thought of that Smile It would still be nice to see if there is a built in feature with nph-import.cgi Tongue

Thanks

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: [AndyNewby] nph-import.cgi In reply to
From what i can tell from my last use of the parser, it will start to import links with the next available ID number. Which, would be 1001. It's not going to overwrite any records, if that is what you are worried about.

Categories have been a different issue, and sometimes I've had categories in the 5,000 or 10,000 range, which does skew the database a bit :)




PUGDOG� Enterprises, Inc.

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