Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 2

...

Description

This may be appropriate if you have specific requirements and conditions. Otherwise we recommend using the techniques from How to find Confluence pages and then do something

  1. You are familiar with SQL
  2. Confluence Server and you have access to the Confluence database
  3. You want to do exact content search and have a large number of pages which would prevent you from using the Search Content approach because it would take too long. 

Steps

  1. Construct a SQL query that selects the pages you are interested in. Test against your database.

  2. Code Block
    sql
    sql
    select '--id ' || contentid from content where content.title like '%title 1%' and contenttype = 'PAGE' and content.spaceid = (select spaceid from spaces where spacekey = 'zconfluencecli2')
    


  3. Figure out the runFromSql parameters for accessing your database.

  4. Put it all together in a single command: 

    No Format
    confluence -a runFromSql --common "-a modifyPage --content \"before existing content\" " --database confluence-3.5.13 --driver postgresql --sql "select '--id ' || contentid from content where content.title like '%title 1%' and contenttype = 'PAGE' and content.spaceid = (select spaceid from spaces where spacekey = 'zconfluencecli2')"