I need to set the parent of a space remotely. It is possible by inserting data in the appropriate tables of bbdd (os_propertyentry table)?

Thank you very much.
Sergio Contreras.

2 answers

1 accepted

Hello Sergio,

Thank you for your request and for your interest in our plugin.

It is possible to set the parent space via HTTP Post remotely.
Use the URL: http://<Confluence_URL>/admin/subspace/changeparentspace.action
Method: POST
Request Header: Content-Type:application/x-www-form-urlencoded
Body: parentKey=<Key_of_the_parent_space>&key=<Key_of_the_space>

To set the parent space is also possible via database but we do not recommend to change any data in the database. It is very dangerous.

Do the following steps to set the parent space:

  1. Get the id of the space description of the desired space:
    1. SELECT spacedescid FROM spaces WHERE spacekey='&lt;SPACE_KEY&gt;';
  2. Set the parent space key in the space description of the desired space:

    1. INSERT INTO os_propertyentry (entity_name, entity_id, entity_key, 
      key_type, boolean_val, double_val, string_val, text_val, long_val, 
      int_val, date_val) VALUES 
      ('confluence_ContentEntityObject',&lt;SPACE_DESCRIPTION_KEY&gt;,'metadatakeys',6,FALSE,0,NULL,'Parent',0,0,NULL);
      INSERT
       INTO os_propertyentry (entity_name, entity_id, entity_key, key_type, 
      boolean_val, double_val, string_val, text_val, long_val, int_val, 
      date_val) VALUES 
      ('confluence_ContentEntityObject',&lt;SPACE_DESCRIPTION_KEY&gt;,'metadata.Parent',6,FALSE,0,NULL,'&lt;PARENT_SPACE_KEY&gt;',0,0,NULL);
  3. Reset the application cache in the Confluence administration
    1. via "Confluence Admin" => "ADMINISTRATION" => "Cache Statistics" => "Flush All"

    2. via URL: http://<Confluence_URL>/admin/cachestatistics.action => "Flush All"

Please test these steps first on a test environment.

I hope this helps to clarify your question. If not, please do not hesitate to contact me again.

Greetings,

Bill Martin
Communardo Support

Thank you very much Bill. 

Works correctly.

 

Best Regards.

 

Sergio Contreras

 

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Tuesday in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

424 views 18 9
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you