-
add the design doc for filtering to the old resource_data
curl -H 'Content-type: application/json' -X POST 'http://localhost:5984/resource_data_big' --data-binary @design_doc.js -
create new target resource_data db
curl -H 'Content-type: application/json' -X PUT 'http://localhost:5984/resource_data' -
start replication from the old resource db to a new one
curl -H 'Content-type: application/json' -X POST 'http://localhost:5984/_replicator' --data-binary @replication_doc.js -
compact new resource_data db in the background - this takes a long time depending upon how big your resource_data db.
curl -H 'Content-type: application/json' -X POST 'http://localhost:5984/resource_data/_compact' &
Created
May 8, 2012 18:17
-
-
Save jimklo/2638166 to your computer and use it in GitHub Desktop.
LR Upgrade Filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "_id": "_design/lr_upgrade", | |
| "couchapp": { | |
| "signatures": {}, | |
| "objects": {}, | |
| "manifest": ["filters/", "filters/resources_only.js", "lists/", "shows/", "updates/", "views/"] | |
| }, | |
| "updates": {}, | |
| "filters": { | |
| "resources_only": "function(doc, req) {\n if (doc.doc_type && doc.doc_type === \"resource_data\") {\n return true;\n } else {\n return false;\n } \n}" | |
| }, | |
| "views": {}, | |
| "lists": {}, | |
| "shows": {} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "_id": "lr_upgrade", | |
| "source": "resource_data_big", | |
| "target": "resource_data", | |
| "filter": "lr_upgrade/resources_only" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think i found the error: "unauthorized to access or create database resource_data" My installation is using admin party for couch so that shouldn't be the case.
Digging into it further, it appears that couch still sees the database files there after you delete the db, even if you don't see the files in the data directory. I deleted my replicator and resource_data dbs to back up and start over, but got this error: "The database could not be created, the file already exists" even though the files didn't exist in the directory. They must be in memory because bouncing couch and trying it again cleared it up.
Everything seems to be working with it now and i'm seeing all of my docs correctly. Thanks for your help.