(partial) synchronization of two Confluence instances

Petr Holodňák August 12, 2012

Is it possible to have two Confluences set up in a way that they share part of content? i.e. one space?

The idea is to have two separate servers with Confluence. One purely for internal purposes (beyond firewall, without access from the internet) and second one published. Is there a way of syncing part of contents from one server to another? Either one way or both ways? Idea is to have one space (or more) that would be edited in internal Conflu. and later (either real time or online od once a day) copied/synced to public.

Is there a way? Or maybe even some tool / script to do it somehow? Or some best practices? We can adjust our expectations according to what is possible.

3 answers

1 accepted

1 vote
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 12, 2012

Confluence Command Line Interface can be used to script coping of pages between instances.

Jaime Hablutzel November 5, 2014

Is there any further documentation for Confluence CLI commands, e.g "copyPage", something more than just the CLI help description?

6 votes
Bruna Griebeler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2012

Hello!

I believe you may consider running Confluence in a clustered environment.

You can run multiple copies of Confluence in a cluster, so that clients (such as a browser) can connect to any copy and see the same information.

However, you would duplicate the entire site, and not only a space.

If you need further information, please take some time to read this page: https://confluence.atlassian.com/display/DOC/Confluence+Clustering+Overview"

Todd_Gamblin November 3, 2013

This isn't suitable for the situation described. The two instances have distinct security requirements, and in this environment you would NOT want to run the two instances clustered.

Dmitry Chubatov January 30, 2014
Confluence command line inteface:
confluence.bat --action copyspace --space spacekey --newSpace spacekey_to --replace --server http://from_wiki.com --user admin --password xxx --targetServer http://to_wiki.com --targetUser admin --targetPassword xxx
if necessary to sync permissions as well (steps 2-3):
2. export permissions to file:
confluence --server http://from_wiki.com--user dmitryc --password xxx --action runFromPageList --space "fromspace" --common "-a getPermissionList --id @pageId@ --outputFormat: 2 --file c:/temp/permissionList.csv --append"
3. import permissions with groovy :
class CSVParser {
static def parseCSV(file, closure) {
def lineCount = 0
file.eachLine() {line ->
def field = line.tokenize(",")
lineCount++
closure(lineCount, field)
}
}
}
use(CSVParser.class) {
File file = new File("c:\\temp\\permissionList.csv")
file.parseCSV {index, field ->
def proc = "C:\\dev\\downloads\\atlassian\\confluence-cli-3.7.0\\confluence.bat --action addPermissions --space to_space --title ${field[1]} --permissions ${field[3]} --group ${field[4]} --serverhttp://127.0.0.1:1990/confluence--user admin --password admin".execute()
def b = new StringBuffer()
proc.consumeProcessErrorStream(b)
println proc.text
println b.toString()
//println "row: ${index} | ${field[0]} ${field[1]} ${field[2]} ${field[3]} ${field[4]}"
}
}
4. cron step(s) 1 (-2-3)
0 votes
Dmitry Chubatov January 22, 2014
1. Confluence command line inteface:
confluence.bat --action copyspace --space spacekey --newSpace spacekey_to --replace --server http://from_wiki.com --user admin --password xxx --targetServer http://to_wiki.com --targetUser admin --targetPassword xxx
if necessary to sync permissions as well (steps 2-3):
2. export permissions to file:
confluence --server http://from_wiki.com --user dmitryc --password xxx --action runFromPageList --space "fromspace" --common "-a getPermissionList --id @pageId@ --outputFormat: 2 --file c:/temp/permissionList.csv --append"
3. import permissions with groovy :
class CSVParser {
static def parseCSV(file, closure) {
def lineCount = 0
file.eachLine() {line ->
def field = line.tokenize(",")
lineCount++
closure(lineCount, field)
}
}
}
use(CSVParser.class) {
File file = new File("c:\\temp\\permissionList.csv")
file.parseCSV {index, field ->
def proc = "C:\\dev\\downloads\\atlassian\\confluence-cli-3.7.0\\confluence.bat --action addPermissions --space to_space --title ${field[1]} --permissions ${field[3]} --group ${field[4]} --server http://127.0.0.1:1990/confluence--user admin --password admin".execute()
def b = new StringBuffer()
proc.consumeProcessErrorStream(b)
println proc.text
println b.toString()
//println "row: ${index} | ${field[0]} ${field[1]} ${field[2]} ${field[3]} ${field[4]}"
}
}
4. cron step(s) 1 (-2-3)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events