Skip to content

Instantly share code, notes, and snippets.

@rswaminathan
rswaminathan / confluence_recover_from_database.rb
Created August 2, 2022 20:59
Confluence Content Recovery from Database
require 'csv'
require 'pathname'
txt = File.open('backup-bible-content.txt').read #dump of `bodycontent` table in txt format
blobs = txt.split("\t")
cols = []
blobs[4..-1].each_slice(3) {|arr| cols << arr} #0 -> content, 1-> contentid
CSV.open('bible-pages.csv').each do |row| #dump of `pages` table in csv format
content_id, _ , title = row
buy
browse
online
shopping
best
shop
price
variety
brands
review
buy
browse
online
shopping
best
shop
price
variety
brands
purchase
{
"id":"cust_2E59D78B-5828-4954-AFF2-CF02D3A26DF3",
"name":null,
"livemode":true,
"created":"2018-06-25T16:21:38Z",
"email":"[email protected]",
"phone":{
"countryCode":""
},
"description":null,