Compare commits

...

2 Commits

Author SHA1 Message Date
1afd622196 got ijson working 2024-10-05 02:03:26 -05:00
c3cd29430f change pymongo host to remote ip 2024-10-05 00:13:07 -05:00

View File

@ -1,10 +1,30 @@
import pymongo
import os
import json
import ijson
import sys
import bookstack
db = pymongo.MongoClient("localhost", 27017).paperless.content
# import paperless database export
# manifest_path = "/mnt/user/media/paperless/media/manifest.json"
f = open("/mnt/tower/media/paperless/media/backup/manifest.json")
manifest = ijson.items(f, 'item')
paperless_docs = {}
for doc in manifest:
fields = doc['fields']
if 'title' in fields and 'content' in fields:
pk = doc['pk']
title = fields['title']
content = fields['content']
check = fields['checksum']
paperless_docs[pk] = {'checksum': check, 'title': title, 'content': content}
db = pymongo.MongoClient("10.0.0.59", 27017).paperless.content
url = 'http://10.0.0.59:6875'