Forums / Developer / Recreating the root node manually?

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

eZ debug

Timing: Jan 19 2025 01:16:43
Script start
Timing: Jan 19 2025 01:16:43
Module start 'content'
Timing: Jan 19 2025 01:16:44
Module end 'content'
Timing: Jan 19 2025 01:16:44
Script end

Main resources:

Total runtime0.8825 sec
Peak memory usage4,096.0000 KB
Database Queries209

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 588.9766180.8281
Module start 'content' 0.00610.7274 769.8047615.5625
Module end 'content' 0.73350.1489 1,385.3672345.0547
Script end 0.8824  1,730.4219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00450.5090210.0002
Check MTime0.00150.1713210.0001
Mysql Total
Database connection0.00100.112010.0010
Mysqli_queries0.783388.76002090.0037
Looping result0.00230.26312070.0000
Template Total0.856597.020.4282
Template load0.00190.215120.0009
Template processing0.854696.828820.4273
Template load and register function0.00020.023110.0002
states
state_id_array0.00080.086710.0008
state_identifier_array0.00100.116220.0005
Override
Cache load0.00170.1950850.0000
Sytem overhead
Fetch class attribute can translate value0.00220.245630.0007
Fetch class attribute name0.00110.122690.0001
XML
Image XML parsing0.00150.173530.0005
class_abstraction
Instantiating content class attribute0.00000.0028110.0000
General
dbfile0.00800.9009270.0003
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
17content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
9content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 40
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs