Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2018-11-13 08:04:22

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,911
Website

Re: transfer over 1600 articles

Just to check in that I made some progress regarding this issue but I have hit a wall regarding a particular issue.

the old install uses the id/title schema and the new one uses the section/title one. The problem lies that there might be some duplicate url-only titles in the old install, not to mention that there might be some more duplicates once the two dbs merge.

The question: Is there a way to search for duplicate url-only titles?


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#12 2018-11-13 10:53:59

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,159
Website

Re: transfer over 1600 articles

This is another manual suggestion if you want to do this before joining your databases:

Use txp:tags to output your list of article url titles and id numbers for each site in CSV format, e.g.:

<txp:article_custom section="news" limit="99999" break="br">
sitename, <txp:article_id />, <txp:article_url_title />
</txp:article_custom>

Then copy what you see and paste into a text file.

Do the same for your other site – changing the site name – and copy those lines onto the end of the same text file. Save that file with all entries from both databases as a .csv file.

Now import that file into excel or numbers and follow one of the “find/highlight duplicate” tutorials online. There are plenty online, here’s one.

If you want to do that after merging your databases, then you’ll find some tips on how to do that using MySQL queries online, e.g. here or here on stackoverflow.

Alternatively, you can sort by column with phpMyAdmin or Sequel Pro and manually scan for duplicate line entries.


TXP Builders – finely-crafted code, design and txp

Offline

#13 2018-11-13 16:38:58

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,911
Website

Re: transfer over 1600 articles

I was hoping that the one below would work…

<txp:if_different no>
<txp:article_url_title />
</txp:if_different>

Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#14 2018-11-13 16:48:07

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,159
Website

Re: transfer over 1600 articles

I was originally going to post that but then realised it will only show you duplicate article urls in the same site. It would work after you have combined the databases.

You probably want this, though (not instead of no and the id too so you can find which articles to modify, sortby the article_url_title as well as a newline break or they’‘ll all run into each other):

<txp:article_custom section="news" limit="99999" sort="article_url_title" break="br">
    <txp:if_different not>
        <txp:article_id />: <txp:article_url_title />
    </txp:if_different>
</txp:article_custom>

TXP Builders – finely-crafted code, design and txp

Offline

#15 2018-11-13 18:49:41

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,911
Website

Re: transfer over 1600 articles

I make the nonot mistake very often. Thanks for picking it up.

It seems that there are no duplicate urls in the old db any more and I think that I changed all urls which also exist in the new site. I also normalised the cf order/titles and moved all entries using adi_matrix. Donkey work is over!

I tried to use Sequel Pro (which I had installed in my computer for use in KG) but I can not make it to connect to Webfaction. :(

My next step, on Thursday, will be to add 2000 to a copy of the new db, and change the few ids I have in the page templates for some static pages.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#16 2018-11-13 21:48:47

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,159
Website

Re: transfer over 1600 articles

colak wrote #315216:

It seems that there are no duplicate urls in the old db any more and I think that I changed all urls which also exist in the new site. I also normalised the cf order/titles and moved all entries using adi_matrix. Donkey work is over!

Excellent. It looks like I’ll have to try adi_matrix sometime. That’s one I don’t know. Might there still be a possibility that you have duplicate urls once you merge the databases. I guess you’ll know if that is a likely proposition.

I tried to use Sequel Pro (which I had installed in my computer for use in KG) but I can not make it to connect to Webfaction. :(

You need to use your SSH connection details to access mySQL remotely with webfaction. The MySQL host and SSH host is your server number, e.g. web###.webfaction.com.

My next step, on Thursday, will be to add 2000 to a copy of the new db, and change the few ids I have in the page templates for some static pages.

I much prefer doing that offline where it’s easier to remedy mistakes and make db copies at each step so it’s easy to go back a step if you make a mistake. One innopportune search and replace can be a headache to revert; it’s much easier to simply reload the step before and try again.


TXP Builders – finely-crafted code, design and txp

Offline

#17 2018-11-14 10:07:58

etc
Developer
Registered: 2010-11-11
Posts: 2,949
Website

Re: transfer over 1600 articles

colak wrote #315216:

It seems that there are no duplicate urls in the old db any more

Sorry, Yiannis, I am not sure not is working well in <txp:if_different /> (kinda special case). Check with

<txp:article_custom section="news" limit="99999" sort="article_url_title" break="br">
    <txp:if_different>
        <!-- <txp:article_url_title /> -->
    <txp:else />
        <txp:article_id />: <txp:article_url_title />
    </txp:if_different>
</txp:article_custom>

etc_[ query | search | pagination | date | tree | cache ]

Offline

#18 2018-11-15 06:56:49

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,294
Website

Re: transfer over 1600 articles

Hi

Have you considered using jmd_csv plugin for your task ?

Cheers.

Offline

#19 2018-11-15 12:24:29

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,911
Website

Re: transfer over 1600 articles

Hi Dragondz,

the truth is that I did not. I have now merged the 2 dbs but I am still working on the images and the layout as the old db was on a non adaptive site. I hope to finish by the end of the week.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#20 2018-11-15 13:52:51

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,159
Website

Re: transfer over 1600 articles

I have now merged the 2 dbs

Well done!


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB