Skip to content

Copy a page tree

Reuse a project template or duplicate a whole section in one command. cp -r copies a page and all of its descendants under another page in the same space.

$ tree ./Templates/Project -L 3
$ cp -r -n ./Templates/Project ./Projects
$ cp -r -y ./Templates/Project ./Projects

The preview shows how many pages would be copied. -y starts the copy. The destination (./Projects) must already exist.

Every copied page gets a prefix so titles don’t clash. The default is Copy of . Set your own:

$ cp -r -y --prefix 'Client B - ' ./Templates/Project ./Projects

Shell uses Confluence’s page-hierarchy copy: pages, attachments, labels, and page restrictions are copied.

  • Same space only. One source per run.
  • At most 200 pages in the source tree — copy large trees subtree by subtree.
  • No pipes and no multiple sources with -r.
  • Folders and spaces can’t be copied.
  • The copy runs as a Confluence background task. If Shell stops waiting, the copy may still finish — check in Confluence.

To copy a few individual pages (not a tree), use plain cp, globs, or find … | cp DEST (max 100).