Gossamer Forum
Home : Products : Links 2.0 : Customization :

splitting up links.db

Quote Reply
splitting up links.db
Hello again,

is there an easy way to split up links.db? the database got quite big (15.000 records) but for different reasons I can not use an sql version.

Therefore I'm going to split up one database into more pieces (the most used categories will get an installation of links2 for its own).

Can you suggest me how to filter and sort out all the records? Shall I import them into f.eg. access or is there a script I can use (or a trick) ;)

Thanks you again,
Tony

Quote Reply
Re: splitting up links.db In reply to
Yea, you would basically have to re-write ALL the LINKS 2.0 scripts, which would mean a lot of time, and since time is money, it would be better to simply upgrade to LINKS SQL as suggested quite a few times in the forums with a large database like you have.

Regards,

Eliot Lee
Quote Reply
Re: splitting up links.db In reply to
thanks for your reply. it will take 1 hour to modify the scripts, not more. this because the only thing to change are some system paths, some titles... and the background color of the admin area :-) .

but what is going to be the biggest work is the links.db file. do you know any tool to sort the links.db out?

thanks again,
tony

Quote Reply
Re: splitting up links.db In reply to
1 hour? please!! What you are asking for is not *very* difficult, but as Eliot said, it would entail rewriting the majority of the script. That's going to take WAY more than 1 hour. Upgrade to SQL, bud. If you can't afford Links SQL try a free program such as inLink.

for example, you'd have to:
-check the size of each Links database before adding any link
-loop through each Links database to do searches (search.cgi and in the admin view)


--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
Quote Reply
Re: splitting up links.db In reply to
hello again :)

I did just read again my posting, sorry for the missunderstanding.

It is going to take 1 hour (except work for links.db) coz I'm going to split up links.db by categories. I beg for pardon for not specifying this.

Therefore my links.db will become (f.eg.)

category 1.. 10 -> a brand new "standalone" links
category 11..20 -> a brand new "standalone" links

I guess I will split it up that way, that instead of having 1 "huge" Links with 100 categories, I'm going to have 4 Links with 25 categories each.

Further... I do not need an "inteligent" search.cgi which would search through all the 4 links installation.

The only, real big work is to sort the links.db... and therefore I've asked if you could please suggest me any trick to split it up "by categories".

Thanks again and sorry for not writing down my question clearly.

Best regards,
Tony

P.S. I will split it up by
a) making copies of the actual links using different directories
b) change the system path for the copies
c) "filtering/splitting" up links.db
Quote Reply
Re: splitting up links.db In reply to
You have no clue how LINKS 2.0 is structured (that's probably why you asked how to do this) and it is NOT a trivial task to re-organize the data structure and also re-write the scripts to work with that data structure.

Again, ALL the scripts would have to be re-written. And the hardiest script to re-write will be the BUILD script.

I guess you don't get it, in terms of time = money and how much MONEY (i.e., TIME) you will save by upgrading to LINKS SQL!

Regards,

Eliot Lee
Quote Reply
Re: splitting up links.db In reply to
Hi again,

Eliot I know how Links is structured, and I did the same before (splitting a links.db into 3 peaces and copying links, replacing system paths, and it was not a big thing to split the links.db, coz of only 100 records, so I did it manually).

The fact is that I have most of the features of Links disabled (f.eg. all the voting stuff). Therefore believe me. As I am running Links it will really not take a lot of time, it did not take a lot of time the first time too.

But this time the only different thing is the size of links.db with about 15,000 records.

Therefore I still would be glad about any suggestion or trick concerning the links.db.

Thanks again,
Tony

Quote Reply
Re: splitting up links.db In reply to
Well, Mr. Know-it-all,

I would recommend doing what junko already suggested....matter of "splitting and looping"...

Learn some basic Perl functions and I am quite sure you will find a solution!

And you should've been more specific about HOW you are using LINKS 2.0, because with the STOCKED release out-of-box version of LINKS 2.0, it would be a challenging task to re-write the scripts to work with modularized database files.

Regards,

Eliot Lee
Quote Reply
Re: splitting up links.db In reply to
Eliot,

I did never say that I know it all... but I can just tell you how I'm using links... and that it will NOT (again) be a big thing to copy/modify/install a splittet links (off course this is true only for the way I'm using it).

I know that you are trying to help me, and thanks for this, but please if I tell you something... just believe me please. I'm not running links as it is/was boxed.

And I do not even think my question is so perl related at all. I'm still asking myself if you could suggest me how to manage a flat db file, that's all... do you suggest to make an easy macro, are there tricks f.eg. by using search and replace functions.... that's all...

I'd be still glad to hear any suggestions on how to split a flat db file.

Tony
(not Mr. Know it All, but Mr. I know how I'm using my links... or what it became after all the mods I've installed/made)

Quote Reply
Re: splitting up links.db In reply to
Hello Mr. Tony,
I understand what You want to do as I have done the same.

I have used excel-2000 and Wordpad to do this.

Let me explain:
1- I load links.db inside Wordpad
2- I search and replace all comma's by ;; or ;: or -;
3- Then I search and replace all | by a comma ,
4- I then save links.db
5- I rename links.db to links.csv
6- I upload links.csv(being a normal txt-flatfile now)inside Excel-2000
7- Now you can sort and edit very easy using any Field
8- Then you split links.csv in the parts you want
9- Rename to example : links1.csv links2.csv and links3.csv
10- Now do the same with categories.db
11- Reverse the whole process to make links1.db links2.db etc etc
12- install 1 or 3 version of links and simple rename the paths to point to: example data1 data2 etc etc
13- rename the paths for building such as to build in pages1 pages2 pages3 etc etc etc.
14 Make your normal index-page and add 3 SSI call inside one behind the other as to call
pages1/index.html
pages2/index.html
pages3/index.html
15- Now using the header & footer of every category You can even crosslink the 3 different links databases

Regards,
Sanuk

Quote Reply
Re: splitting up links.db In reply to
I use to use Excel and it's very easy to use as all you need to do is make some basic macro's. You don't even need to know much about VBA to do it. I just made a spreadsheet and added buttons to automate the following:

Importing links.db
Adding a fields/fields
Deleting a field/fields
Adding/deleting the db delimiter
Opening notepad/wordpad
Clearing spreadsheet

The only thing I didn't get round to adding is a button to export the finished data into links.db. (I just copied and pasted it from the spreadsheet)


Glenn

Links 2 Mods Site:
http://cgi-resource.co.uk/pages/links2mods.shtml
Quote Reply
Re: splitting up links.db In reply to
Thanks a lot!! I did it... it took me less than one hour to download/copy for 4 times/modify/upload links itself... and about 2 hours to sort all the links.db with excel and wordpad :-)

Thanks a lot for your tips ;)

Tony
alias Mr. I know how MY links works ;)

p.s. the sql version would be great, but for my use this way around is the cheapest ;)