You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by bryan rasmussen <ra...@gmail.com> on 2011/09/27 11:16:24 UTC

moving database

Hi,

I have a number of dbs in a couchdb installation that got for no good
reason got moved to a virtual machine. Now I would like to just copy
everything over into a new machine. Can I do that by copying stuff in
the filesystem? Or do I have to use database replication. Is there any
particular tool I could use that would take a bunch of records saved
to a filesystem and load them into a new couchdb instance?

Thanks,
Bryan Rasmussen

Re: moving database

Posted by CGS <cg...@gmail.com>.
..or, if you prefer something fancier, you can type this in a terminal:

HOST="" && TARGET="" && for var in $(curl -X GET $HOST/_all_dbs | awk 
'{a = $1; sub(/\[/,"",a); sub(/\]/,"",a); split(a,b,","); for(i in b) 
{sub(/\"/,"",b[i]); sub(/\"/,"",b[i]); print b[i]}}') ; do curl -X POST 
$HOST/_replicate -d ’{"source":"$HOST/$var", "target":"$TARGET/$var"}’ ; 
done

Don't forget to fill in HOST and TARGET before running it. Just a script 
for fun (I hope I didn't make any typo or something like that).




On 09/27/2011 11:47 AM, JC de Villa wrote:
> Just copy the .couch files from the original to the VM. No need to do
> anything fancy.
>
> On Tue, Sep 27, 2011 at 5:16 PM, bryan rasmussen
> <ra...@gmail.com>wrote:
>
>> Hi,
>>
>> I have a number of dbs in a couchdb installation that got for no good
>> reason got moved to a virtual machine. Now I would like to just copy
>> everything over into a new machine. Can I do that by copying stuff in
>> the filesystem? Or do I have to use database replication. Is there any
>> particular tool I could use that would take a bunch of records saved
>> to a filesystem and load them into a new couchdb instance?
>>
>> Thanks,
>> Bryan Rasmussen
>>
>
>


Re: moving database

Posted by JC de Villa <jc...@gmail.com>.
Just copy the .couch files from the original to the VM. No need to do
anything fancy.

On Tue, Sep 27, 2011 at 5:16 PM, bryan rasmussen
<ra...@gmail.com>wrote:

> Hi,
>
> I have a number of dbs in a couchdb installation that got for no good
> reason got moved to a virtual machine. Now I would like to just copy
> everything over into a new machine. Can I do that by copying stuff in
> the filesystem? Or do I have to use database replication. Is there any
> particular tool I could use that would take a bunch of records saved
> to a filesystem and load them into a new couchdb instance?
>
> Thanks,
> Bryan Rasmussen
>



-- 
JC de Villa