-
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 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 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" | |
} |
Yes, the easiest is if you have access to Futon; http://localhost:5984/_utils/status.html (FWIW: i use 'ssh user@server -L<localport>:localhost:5984' where <localport> is some open port on my local client to access couchdb via the ssh tunnel)
if you don't see the replicator running, it's possible it's failing immediately... you can check the status of the replicator, by looking for the job in _replicator db. It will show states like triggered, completed, error. if you see an error, check the couch log for more details.
- Jim
Jim Klo
Senior Software Engineer
Center for Software Engineering
SRI International
…On May 14, 2012, at 12:27 PM, joe hobson wrote:
> 3) start replication from the old resource db to a new one ...
is there any way to monitor progress for the migration? I ran step 3 fifteen minutes ago and i'm still showing 0 records in resource_data db.
**Also:** step 4 command is still missing a single quote before the couch url.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/2638166
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
is there any way to monitor progress for the migration? I ran step 3 fifteen minutes ago and i'm still showing 0 records in resource_data db.
Also: step 4 command is still missing a single quote before the couch url.