Copy Page Tree - Overview

The article walks you through the following articles:

Page tree

A page tree is a hierarchical structure of pages that begins with a selected parent page and has multiple levels of child pages.

In Confluence, you can view the page tree using the Page tree macro. For more information on how to create a page tree macro, click here.

Introduction

The Copy Page Tree app allows you to add a page action to copy not only the current page but a complete page hierarchy. The app supports adjustments of page names to avoid problems with page name duplication. Use text search/replace to customize content on the destination pages. Copy attachments, labels, properties, and permissions. Copies can be saved to other Spaces as well.

 

https://youtu.be/AFCxeiOTMjU

Features 

  • Copy an entire page tree, Parent Page and its Child Pages, including (optionally) Attachments, Labels, Properties, Permissions

  • Search/Replace one or more pairs of strings to customize page content 

  • Supports page name adjustments to avoid issues with page name duplication

  • Review the page tree copy

  • Save form values for more efficient copies of the same page tree

  • The progress bar gives real-time feedback about the progress of the copy job

  • Quick links to Source and Destination pages upon copy completion

  • Delete an entire page tree

Use case

  • Create documentation templates for releases

  • Create new spaces and repeat information that needs to be used again with a simple word change with the find/replace

  • Update multiple pages by copying a tree and using the find/replace to update pages. Then use the deleted tree to remove the old pages

  • Delete Page Tree to clean up spaces when there are large changes

  • Count the number of pages in a space

Permissions

If you have revoked permissions for the group 'confluence-users' in Space Settings → Permissions then you may need to add the 'Copy Page Tree' app user to Individual Users and grant All → View to the app user.

The Copy Page Tree app works without adding a 'Copy Page Tree' app user permission if you have at least the All → View permission granted to 'confluence-users'.  If you revoke All → View from 'confluence-users' then you must add permissions for the 'Copy Page Tree' app user.

An "app user" is a user that exists in Confluence to represent an app when it is performing actions.  If you click the 'Edit Permissions' button and use the 'Add' button to add an individual user you will discover that the user picker recognizes your installed apps as users, like 'Copy Page Tree'.

Copying Permissions

When copying a tree with the Copy Permissions option checked, the operation will copy permissions that are set for the pages.

Here are some details of how permissions are dealt with for page tree copies

  • If the user does not have permission to access a page, the page is not included in the copy of the page tree.

  • If a page is a child of a restricted page, it properly inherits restrictions of the parent page (ie. it cannot be copied over by unauthorized users).

  • If the user is only authorized for viewing the page but not to edit the page (“Anyone can view, only some can edit” permission level), the page is copied with all permissions (View / Edit permission are preserved).

    • Atlassian has told us that their API that is causing this behaviour works as intended, it allows the user to make a tree of pages as a template (e.g. new project) and then copy and start working on the pages. 

Therefore, a user can copy a page that they can view but not edit and they will have edit permissions on the newly created copy.  Of course, the permissions on the original content remain unchanged.

Limitations 

The following limitations have been set to reduce server load and keep performance (i.e. page speed) optimal. We're open to your feedback on these limits. 

  • The number of pages that can be copied in a page tree is currently limited to 2000 pages.

  • The size of any particular attachment that can be copied is currently limited to 5 megabytes.