Recreating the root node manually?

Author Message

Trond Åge Kvalø

Thursday 26 August 2004 4:47:34 am

As some of you might have noticed, my root node has suddenly disappeared.

This results in the error "object not available" as soon as I have logged in.

By changing the node id number in the URL I'm able to view other nodes. But I can not publish them. If I do I get the same error.

I peeked into the Trash folder and it seems that my root node has found a new home there. But when I try to Restore the folder I get the dreaded "Error / kernel (3) Object unavailable" again.

In another thread I read about someone restoring their root node manually using inserts in five of the database tables.
http://www.ez.no/community/forum/general/lost_my_root_node

Can anyone shed some light on how to do this? The folder had a name, a short description and a description, so in theory I only need to update those fields in the database, right?

But when I look at the tables I can't really see where to put things.

I also had a chat with my ISP that could tell me that they have backup from 03:00 today, and one older backup from one week ago, so not much use to use their backup either.

Can anyone please help me.

best regards
trondåge

trondåge

Björn Dieding@xrow.de

Thursday 26 August 2004 5:07:33 am

hmmm I know this is possible, I did this once or twice too

how about you take the exact same data like from the clean_data.sql

kernel/sql/*?

I think you need to fetch data from tables

contentobject*
node_assignments
maybe url_alias

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Trond Åge Kvalø

Thursday 26 August 2004 6:05:00 am

Hi Björn, and thanks for replying.

I see that this approach has its uses too, but how about renaming all the old eZ database tables, installing eZ in a new directory, copying all the needed settings/* and design/* from the old site, and then transferring the needed data from the old tables?

Hmmm, that actually sounds like the GUI form of what you have suggested...

I also remembered that I have some custom classes, so I will probably have to transfer the contents of all the ezcontentclass* tables as well, right?

My main point is, if I can get away with recreating the root node using just a few insert statements, as mentioned in the above thread, then I will try. But emptying the table totally seems to me like shooting sparrows with cannonballs. Then I might as well start all over again, and maybe even upgrade to 3.4.1 at the same time.

best regards
trondåge

trondåge

Björn Dieding@xrow.de

Thursday 26 August 2004 7:08:07 am

I never told you the delete/empty anything from the db besides the root object and node.

Try just the place the root object and node.

I also makes sense to complely remove that node and object manually and setup manually again.

I don't need to touch anything else beside those tables.

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Trond Åge Kvalø

Thursday 26 August 2004 8:03:17 am

You're right, you did not mention anything about deleting the whole table. My mistake. Sorry, it's just that I'm little frustrated at the moment, and I don't understand which tables I need to edit to remove only the object with id=1.

So, I've made a little list of what I need to do in order to combine a recreation of my site + an upgrade to 3.4-1.

<i>Steps needed to recreate my site after deleting the root node.

1. rename all eZpublish tables to ez_ez*
2. rename the current ez directory
3. unpack the eZpublish 3.4-1 tar.gz file
4. rename the new eZpublish directory to the old name
5. run the setup again
6. copy the all the design/* + settings/* + var/* files from the old version
7. transfer the contents of ez_ezcontentclass* tables
8. transfer the contents of ez_ezcontentobject* tables where id<>1
9. transfer only the contents of name, and datatext1 and datatext2 where id=1</i>

Does this list seem ok? Or are there things that I have forgotten?

Any comments are highly appreciated, perhaps someone from the eZ crew could chip in as well.... ;-)

Best regards
trondåge

trondåge

Björn Dieding@xrow.de

Friday 27 August 2004 3:18:22 am

Those 2 other tables hold informatio too

node_assignments
maybe url_alias

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Trond Åge Kvalø

Monday 30 August 2004 2:22:49 am

OK, thanks Björn.

At the moment I'm at stage seven in my new list:

<i>7. transfer the contents of ezcontentclass* tables
8. transfer the contents of the eznode_assignment table
9. transfer the contents of the ezurl_alias table
10. transfer the contents of ezcontentobject* tables where id<>1
11. transfer only the contents of name, and datatext1 and datatext2 where id=1</i>

And to try to avoid any more major f**kups, I need a little guidance in the mySQL world.

When I renamed the tables I used the mySQL command RENAME TABLE, what I see now is that I perhaps should have used BACKUP TABLE.

I think renaming the ez_ezcontentclass* back to ezcontentclass* should be enough to get these data straight. Is that a correct assumption?

If this is true I believe that holds for the next two steps as well.

The tricky part (for me) comes in step 10. Does anyone know how I would write that statement?

And as far as I can see step 11 is best handled through the admin interface.

Any thoughts anyone?

BTW: I wholeheartedly aggree with all who vote for erase-protection on the root node :-/

best regards

trondåge

Trond Åge Kvalø

Monday 30 August 2004 7:12:24 am

> The tricky part (for me) comes in step 10.
> Does anyone know how I would write that statement?

replace into ezcontentobject select * from ez_ezcontentobject where id<>1
replace into ezcontentobject_attribute select * from ez_ezcontentobject_attribute where contentobject_id<>1
.
.
.

And so on should do the trick.....

But it doesn't. There are massive improvements though :-) My design is just like it was before, and all the templates are in the correct place and there is no error in the eZdebug. But the child nodes of the root folder are not shown in the menu, nor in the admin interface. Even if the checkbox show children is checked.

Does anyone know if I need to transfer the content of other tables as well to make things work?

best regards

trondåge

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.