Compare commits
2 Commits
748609919b
...
1afd622196
Author | SHA1 | Date | |
---|---|---|---|
1afd622196 | |||
c3cd29430f |
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user