Compare commits
No commits in common. "1afd6221963ff2c23706a88a8cda61fd62e80bc6" and "748609919bd2c4ad089e2ed2a01bb9924e27bafc" have entirely different histories.
1afd622196
...
748609919b
@ -1,30 +1,10 @@
|
|||||||
import pymongo
|
import pymongo
|
||||||
import os
|
import os
|
||||||
import ijson
|
import json
|
||||||
import sys
|
import sys
|
||||||
import bookstack
|
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'
|
url = 'http://10.0.0.59:6875'
|
||||||
|
Loading…
Reference in New Issue
Block a user