eZ Community » Forums » General » Problems editing emigrated dabatase...
expandshrink

Problems editing emigrated dabatase element

Problems editing emigrated dabatase element

Tuesday 03 February 2015 12:03:12 pm - 19 replies

Hi, 

Few days ago, I migrated a database from Access to EzPublish database. The process was successful, all the elements are shown correctly in my site.

Even though, when I edit one element from the back office and I save the changes, the browser don't find any element that contains any word of the edited element. However, before I've edited the mentioned element, the browser found it doing the same search that now isn't working.

Can you help me, please?

Thanks,

 

Modified on Tuesday 03 February 2015 12:04:51 pm by Josep Palomino

Tuesday 03 February 2015 6:52:10 pm

Hello Josep,

It might really help us better understand your import accuracy if you were to share the code you used to import this content. There might still be issues with this ...

Another helpful step would be to enable DebugOutput and enable DebugRedirection, clear all caches, then try to publish a modified content object and thoroughly review the var/log/error.log entries that could be being created.

In general to be able to actually help you we will need you to describe in much greater detail the actual actions your taking and the errors your encountering (please be verbose and provide actual reproducible examples). "isn't working" is really hard to troubleshoot by itself. 

I hope this helps!

Cheers,
Heath

Friday 06 February 2015 3:08:02 pm

Quote from // Heath :

javascript:mctmp(0);Hello Josep,

It might really help us better understand your import accuracy if you were to share the code you used to import this content. There might still be issues with this ...

Another helpful step would be to enable DebugOutput and enable DebugRedirection, clear all caches, then try to publish a modified content object and thoroughly review the var/log/error.log entries that could be being created.

In general to be able to actually help you we will need you to describe in much greater detail the actual actions your taking and the errors your encountering (please be verbose and provide actual reproducible examples). "isn't working" is really hard to troubleshoot by itself. 

I hope this helps!

Cheers,
Heath

I found a similar problem in this post http://share.ez.no/forums/developer/problems-with-the-tree-url-aliases-paths, but I couldn't find the solution yet.

 

In the logs, I have found some errors like this :"eeZContentObjectTreeNode::pathWithNames() failed to fetch path of node 1458, falling back to generated url entries. Run updateniceurls.php to fix the problem."

Any idea?

Modified on Friday 06 February 2015 3:23:09 pm by Josep Palomino

Saturday 07 February 2015 9:28:33 am

Hello Josep,

Have you tried running the ezpublish_legacy/bin/php/updateniceurls.php script?

The error log entries are prolly pointing you in the right direction happy.gif Emoticon

I hope this helps!

Cheers,
Heath

Monday 09 February 2015 12:36:50 pm

Quote from // Heath :

Hello Josep,

Have you tried running the ezpublish_legacy/bin/php/updateniceurls.php script?

The error log entries are prolly pointing you in the right direction happy.gif Emoticon

I hope this helps!

Cheers,
Heath

I fixed the URL error. Now, file error log is empty, but I have the same problems with search items...

Here are the steps that I followed:

1. I import data into ezDB.

2. Search any item without problems.

3. Edit the find item.

4. When I save the changes, I can't find this item with search enginee , but the item is there because I can see it, and edit, etc.

 I don't understand what's the problem, my script inserts the fields like the backoffice does, I checked it many times, what it happens when I edit the data inserted before?

Thanks,

Modified on Monday 09 February 2015 5:32:33 pm by Josep Palomino

Friday 13 February 2015 2:21:25 pm

Hello Josep,

Are you using the the DelayedIndexing feature? Is your site.ini : DelayedIndexing setting enabled or disabled?

If delayed indexing is enabled then it would make sense that new (or modified) content object content is not indexed until you run the updatesearchindex script.

We spoke about this recently in another forum thread, http://share.ez.no/forums/general...object_word_link-issues#comment85614

I hope this helps!

Cheers,
Heath

Modified on Friday 13 February 2015 2:22:24 pm by // Heath

Monday 16 February 2015 11:59:38 am

Quote from // Heath :

Hello Josep,

Are you using the the DelayedIndexing feature? Is your site.ini : DelayedIndexing setting enabled or disabled?

If delayed indexing is enabled then it would make sense that new (or modified) content object content is not indexed until you run the updatesearchindex script.

We spoke about this recently in another forum thread, http://share.ez.no/forums/general...object_word_link-issues#comment85614

I hope this helps!

Cheers,
Heath

Thanks!!!!!! the problem is now solved. I changed the parameter DelayerIndexing to enabled and after that I can search modified items without problems.

I never thought I would find the solution. Thank you very much happy.gif Emoticon

Monday 16 February 2015 2:47:17 pm

Hello Josep,

I think you should try to run the updatesearchindex script via cron to ensure that your search index is up to date and accurate as well. If you don't run this script and you change your content object content you would have problems searching for new content added during publishing of an edited content object.

You may still have import problems and may be ignoring them by enabling DelayedIndexing without using the updatesearchindex script to keep your search index up to date and accurate.

I hope this helps!

Cheers,
Heath

Monday 16 February 2015 5:26:28 pm

Quote from // Heath :

Hello Josep,

I think you should try to run the updatesearchindex script via cron to ensure that your search index is up to date and accurate as well. If you don't run this script and you change your content object content you would have problems searching for new content added during publishing of an edited content object.

You may still have import problems and may be ignoring them by enabling DelayedIndexing without using the updatesearchindex script to keep your search index up to date and accurate.

I hope this helps!

Cheers,
Heath

Hi!

I've tried running the updatesearchindex script in the both ways: first, with the DelayerIndexing parameter disabled, having the same problems that I mentioned, and then, with this parameter enabled, which solves the problem.

I'll continue testing to look for new errors.

Thanks again.

 

Tuesday 17 February 2015 10:39:00 am

Now I see the problem. If I add new content, I can't search them (with parameter DelayerIndexing enabled). If I execute updatesearhindex, I find  new content but I don't find edited content....

sad.gif Emoticon

Modified on Tuesday 17 February 2015 10:40:11 am by Josep Palomino

Tuesday 17 February 2015 11:22:59 am

Hello Josep,

I'm glad you understand a bit more what I was trying to describe.

I strongly urge you to share your import script for review of problems it might be introducing.

 

Cheers,
Heath 

Tuesday 17 February 2015 12:44:46 pm

Quote from // Heath :

Hello Josep,

I'm glad you understand a bit more what I was trying to describe.

I strongly urge you to share your import script for review of problems it might be introducing.

 

Cheers,
Heath 

I've created a dropbox with 2 files:

 1. C# code

  2. SQL file result

Dropbox access: 

https://www.dropbox.com/sh/y7vjcbiwma7rv01/AAA_3LbFgagovIubNkUBXSWJa?dl=0

 

Thanks,

 

 

Modified on Tuesday 17 February 2015 12:46:16 pm by Josep Palomino

Tuesday 17 February 2015 3:23:33 pm

Ok ... Time out!

I know exactly what your trying to do here but ... your dead wrong.

See: I did the exact thing your trying to do now back in 2001 with eZ Publish v2 when it was sanely possible (tho i'll advised) to do do the same thing only with FileMakerPro creating sql from csv exports.

But with eZ Publish 3 the complexity involved went off the charts which is why what your trying to do now is simply the -worst- way possible to import content into eZ Publish.

Please, for the love of all that is holly and sacred, just stop, stop now and save everyone you hold dear to you by stoping what your doing. It's wrong and you should not do it.

You can not rewrite the complexity of the eZ Publish (Legacy) PHP API into your little c# ezp sql generator script. Your going to fail to capture the true requirements implemented in the eZ Publish (Legacy) PHP API's source code and create a never ending cascade of mistakes, errors and problems both seen and unseen, noticed and unnoticed.

Your corrupting your database and you don't even seem to care! If your going to import content into eZ Publish without corruption you need to use the eZ Publish (Legacy) PHP API! 

The right way™

  1. You need to export your source data into UTF8 XML or at the very least CSV.
  2. You need to import your exported data correctly using the data_import extension to import your exported data which uses the eZ Publish (Legacy) PHP API, https://github.com/mugoweb/data_import
  3. This solution works for both a one time import or updating of existing content

Please import data into eZ Publish the right way! You really don't understand the depth of problems you introduce and how they negatively affect others in the future .. otherwise.

//kracker

THEME: 

Biggie "The Notorious B.I.G." (ft. Eminem) - Dead Wrong ...

https://www.youtube.com/watch?v=44bV8td2Wew#t=190

>>Jay-Z Feat. Eminem - Renegade ...

https://www.youtube.com/watch?v=0OVNXTkV414#t=77

Bad Meets Evil - Fast Lane ft. Eminem, Royce Da 5'9 ...

https://www.youtube.com/watch?v=rJOsjP33nF4

Eminem - Role Model ...

https://www.youtube.com/watch?v=ubEublECnMU#t=42

Eminem - One Shot Two Shot ...

https://www.youtube.com/watch?v=DKAb4YD0Euc

Eminem - Go To Sleep ...

https://www.youtube.com/watch?v=Mu19RwHhQWI

 

Tuesday 17 February 2015 4:11:28 pm

Hello Josep,

First, Thank you for sharing your import solution for review.

In short, for those viewing this thread in the future Josep shared an uncompiled c# program to generate ez mysql sql statements and an example sql file of the sql the programs creates.

Second, while excessive and hard to hear what kracker suggests is based on truth. Your efforts (and time) would be much better served by using the data_import extension to import your content into eZ Publish using the eZ Publish PHP API.

Third, I think the above because frankly your c# program is very hard to read / follow / understand and the sql it generates is in many orders of magnitude even harder to follow. It's just very hard to troubleshoot. 

There is no guarantee that the smallest mistake or omission in your c# assumptions of the api in general would not introduce corruption that would be very hard to solve afterwards. If you were using the eZ Publish PHP API you would be much safer and better off all together.

Fourth, I think at the very least you should at least drop the ezsearch_* tables data population from your c# data export sql generator. It's not needed and for reasons I can not tell without further extensive time investments your simply doing it wrong and it's not working.

You should instead run the following script after your generated sql is run. This script command (note: you must use the --clean option!!!). This script command will remove all search content and re-index all search content.

php -d memory_limit=-1 bin/php/updatesearchindex.php --clean

Specifically you should comment out calls to 'WriteEzWordLinks', 'InsertSearchWordIdFunction' and 'InsertWordIdFunction' as what it is trying to do is both incomplete and as I've said above it's just not needed.

Maybe this simple edit to your c# program will help you solve this search problem but regardless I must strongly strongly urge you to export your data to standard format and import your data using the data_import extension's php based api as doing with the data_import extension would mean a safe, reliable and dependable import (which you have already proven in the smallest way your own is not). 

I hope this helps!

Cheers,
Heath 

Modified on Tuesday 17 February 2015 8:39:07 pm by // Heath

Tuesday 17 February 2015 5:55:26 pm

Quote from // Heath :

Hello Josep,

First, Thank you for sharing your import solution for review.

In short, for those viewing this thread in the future Josep shared an uncompiled c# program to generate ez mysql sql statements and an example sql file of the sql the programs creates.

Second, while excessive and hard to hear what kracker suggests is based on truth. Your efforts (and time) would be much better served by using the data_import extension to import your content into eZ Publish using the eZ Publish PHP API.

Third, I think the above because frankly your c# program is very hard to read / follow / understand and the sql it generates is in many orders of magnitude even harder to follow. It's just very hard to troubleshoot. 

There is no guarantee that the smallest mistake or omission in your c# assumptions of the api in general would not introduce corruption that would be very hard to solve afterwards. If you were using the eZ Publish PHP API you would be much safer and better off all together.

Fourth, I think at the very least you should at least drop the ezsearch_* tables data population from your c# data export sql generator. It's not needed and for reasons I can not tell without further extensive time investments your simply doing it wrong and it's not working.

You should instead run the following script after your generated sql is run. This script command (note: you must use the --clean option!!!). This script command will remove all search content and re-index all search content.

<span style="font-size: 1.1em;">php -d memory_limit=-1 bin/php/updatesearchindex.php --clean</span>

Specifically you should comment out calls to 'WriteEzWordLinks', 'InsertSearchWordIdFunction' and 'InsertWordIdFunction' as what it is trying to do is both incomplete and as I've said above it's just not needed.

Maybe this simple edit to your c# program will help you solve this search problem but regardless I must strongly strongly urge you to export your data to standard format and import your data using the data_import extension's php based api as doing with the data_import extension would mean a safe, reliable and dependable import (which you have already proven in the smallest way your own is not). 

I hope this helps!

Cheers,
Heath 

I have fixed the search problem commenting the lines that you told me and it seems that it works fine.

But I would like to do it right using data_import module. What do you mean with standard format? I don't know how to convert my access database to a format that the data_import can import correctly.

I haven't found any examples. For that reason I chose to do the c# script, but seeing some comments, it was a very bad decision sad.gif Emoticon

Thanks again

Tuesday 17 February 2015 8:45:37 pm

Hello Josep,

I'm pleased that my suggestions have helped in the short term.

I do strongly recommend you follow our advice on exporting your access db data into XML (which is a 'standard format') and using the data_import extension to import your content.

There are thousands of examples of how to export access db data to XML

https://www.google.com/#q=convert%20access%20database%20to%20xml

Here is one simple one for example, (it seems like it's built in!):

http://www.dummies.com/how-to/con...porting-access-2003-data-to-xml.html

I hope this helps!

Cheers,
Heath

Modified on Tuesday 17 February 2015 8:46:03 pm by // Heath

Wednesday 18 February 2015 12:19:48 am

Quote from // Heath :

Hello Josep,

I'm pleased that my suggestions have helped in the short term.

I do strongly recommend you follow our advice on exporting your access db data into XML (which is a 'standard format') and using the data_import extension to import your content.

There are thousands of examples of how to export access db data to XML

https://www.google.com/#q=convert%20access%20database%20to%20xml

Here is one simple one for example, (it seems like it's built in!):

http://www.dummies.com/how-to/con...porting-access-2003-data-to-xml.html

I hope this helps!

Cheers,
Heath

Ouch! I really thought that was needed some special structure in the XML to correctly import data...

I try it this way and,  I will keep you informed of my progress.

Thank you so much

Modified on Wednesday 18 February 2015 9:00:00 am by Josep Palomino

Wednesday 11 March 2015 10:07:25 pm

Hello there,

Good work Heath happy.gif Emoticon

One question for you Josep: which eZ publish version are you importing the data to ?

Thursday 12 March 2015 4:39:30 am

Hello Bertrand,

Thank you very much for your kind words! You brightened up my afternoon a little happy.gif Emoticon

BTW. Very good question to ask Josep! I guess if your going to ask which version of eZ he is using to import into, it might also might have been a good idea to ask what kernel stack he is using as well. Re-reading this thread it seems we naturally assumed legacy since his question was not posted to the eZ Platform v5 New Stack forum instead.

@Josep

How goes your efforts to export your access database content to XML and import the exported XML (of access database content) into eZ Publish using the data_import solution? I'm curious to hear from you have made postive results / progress or if you have more related questions.

I would be happy to continue helping you if I can, if you need more help, if your not already done with these efforts.

I look forward to hearing from you again. Best wishes

Cheers,
Heath

Modified on Thursday 12 March 2015 4:41:19 am by // Heath

Thursday 12 March 2015 5:08:34 am

Quote from the THEME, "Let it go dawg, it's over... (chorus hook)

*sound of crickets chirping*

Na, you didn't listen to the THEME or the meaning of the lyrics ...

They never really listen ∞ Air's expensive, lets all try to save some, by holding our breaths till, the day they really do. ∏

C# ezp mysql insert generator == Meth; "Meth .. never once", http://hugelolcdn.com/i700/50916.jpg

//kracker
THEME: Eminem - Nail in the Coffin, https://www.youtube.com/watch?v=gF1A1VcRyRg

THEME Lyrics: http://genius.com/Eminem-nail-in-the-coffin-lyrics

http://images.rapgenius.com/020c8...0dccb2360fb6bc2c42a199.619x412x1.jpg

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from