Powershell
Does anyone have the latest API endpoint for triggering Confluence Cloud backups via REST API? The old /wiki/rest/obm/1.0/runbackup no longer works. Looking for a way to automate backups using an API.
/wiki/rest/obm/1.0/runbackup
Thanks in advance!
Hi @Michael ,
did u read the following article https://confluence.atlassian.com/cloudkb/automate-jira-confluence-cloud-backups-1488597169.html ?
It seems to be available just for enterprise license.
Hope this helps,
Fabio
Hi @Michael,
For our Confluence instance, the old /wiki/rest/obm/1.0/runbackup API endpoint still seems to work with the Powershell script backup-confluence-api-token.ps1 if you replace
$backupReady = $statusContent.alternativePercentage -eq "100%"
by
$backupReady = $statusContent.alternativePercentage -eq "100"
i.e., if you remove the '%' that used to be part of "$statusContent.alternativePercentage". However, note that "alternativePercentage" only takes the values 0 and 100.
This snippet can be found in line 54 of backup-confluence-api-token.ps1
I hope this still helps.
Kind regards,
Jonas
In addition
...$headers = @{ "Authorization" = "Basic $auth" "Content-Type" = "application/json" "Accept" = "application/json"}[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12...try{ # Create a Confluence Cloud backup $backupResponse = Invoke-WebRequest -Method POST -Uri $backupEndpoint -Headers $headers -Body $bodyjson # This will only execute if the Invoke-WebRequest is successful. $statusCode = $backupResponse.StatusCode} catch { $statusCode = $_.Exception.Response.StatusCode.value__}# Check if backup creation was successfulif (($statusCode -eq 200) -or ($statusCode -eq 406)) { # Wait for the backup to be ready $backupReady = $false ...
It looks like you're new here. Sign in or register to get started.