Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 74F5AFB8C for ; Mon, 25 Mar 2013 22:18:07 +0000 (UTC) Received: (qmail 4263 invoked by uid 500); 25 Mar 2013 22:18:06 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 4215 invoked by uid 500); 25 Mar 2013 22:18:06 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 4205 invoked by uid 99); 25 Mar 2013 22:18:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Mar 2013 22:18:05 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.212.176] (HELO mail-wi0-f176.google.com) (209.85.212.176) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Mar 2013 22:18:00 +0000 Received: by mail-wi0-f176.google.com with SMTP id hm14so10788253wib.9 for ; Mon, 25 Mar 2013 15:17:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-originating-ip:in-reply-to:references :from:date:message-id:subject:to:content-type:x-gm-message-state; bh=GxRAifbUPYL7F2gYGssk212sapcAsdX3FP6yr9+Ys+8=; b=phd7JERcuIF0far/rroy6os7hdAh1NVK0D01fWTkXOP2xF+4owB0ORWRBNXWtdSufU rXpLskhnJbVFPPBgQzWE6i4Nkrs38Kaf2t9O8KJpeQlzA5TkcQELocVC8ddZGazm0gJz n/AXdND+34WEx85erIPcThvEVrtGG3iqbMPGxLTKRXNuupLaiBOWq7DqmEid4cY1kRRQ aoodVNwsT97bKE4PBlaIAy3zMGcwFyjyPN//x9Mapkhe+Gtouu7Nfp8VjS747LV9vl+9 j4dDEk3cpe2r4R0b2LFyH/UVeo357YCTlYi+vZyp7yh3voKahvGH1xJ+B/Gyass7mAwm jdLg== X-Received: by 10.181.11.164 with SMTP id ej4mr20404161wid.29.1364249859825; Mon, 25 Mar 2013 15:17:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.32.106 with HTTP; Mon, 25 Mar 2013 15:17:19 -0700 (PDT) X-Originating-IP: [68.5.117.177] In-Reply-To: <20130325221107.GS26873@translab.its.uci.edu> References: <0DE19DE6-A63A-4275-A424-33E000302ADC@couchbase.com> <20130325221107.GS26873@translab.its.uci.edu> From: Mark Hahn Date: Mon, 25 Mar 2013 15:17:19 -0700 Message-ID: Subject: Re: copy docs from one db to another? To: user Content-Type: multipart/alternative; boundary=f46d0438914b47b5a304d8c72ce4 X-Gm-Message-State: ALoCoQlyA/lSWQbisX/rLWED73EkwDBp0sxP8GtD6CnCtTnMBsV0BljYnk4qnADTxfptlA+Z0nBa X-Virus-Checked: Checked by ClamAV on apache.org --f46d0438914b47b5a304d8c72ce4 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable That's awesome. I forgot futon could show an entire doc in json. Now I have lots of ways to do it. On Mon, Mar 25, 2013 at 3:11 PM, James Marca w= rote: > For a completely programming free approach, sometimes if I have, say > just 2 or 3 design docs, I'll open them up in futon in the browser in > separate tabs in the source view mode (so I can see the _rev field, > etc). Then in yet another tab, I delete the database, and then create > create an empty database with the same name. Then I go to each of the > tabs, edit the design docs to get rid of the "_rev" field, and click > save to write the design docs to the new db. > > It works and does exactly the same thing as getting the designdocs to > a file, opening up the files, deleting the revision, and then using > curl to PUT the docs in the new database > > I've tried the replication route too, but that got annoying pretty > fast. Better for me was to have a clean db with design docs stored so > as to get a cannonical set of design docs without having to use my > file system, but then I would cut and paste the design doc source via > futon (create any old new document, replace its contents with the > design doc contents (less the revision number), and click save. > > Quick and dirty, but it works okay. > > Regards, > James > > On Mon, Mar 25, 2013 at 02:49:04PM -0700, Mark Hahn wrote: > > thx > > > > > > > > On Mon, Mar 25, 2013 at 2:46 PM, Jens Alfke wrote: > > > > > > > > On Mar 25, 2013, at 2:35 PM, Mark Hahn > > mark@hahnca.com>> wrote: > > > > > > I have a database with a zillion docs that I need to empty. I just > want > > > the design docs left behind. > > > > > > If you delete the docs, you=92ll leave behind tombstone revisions, so= the > > > database won=92t strictly speaking be empty (unless you call purge > > > afterwards.) > > > > > > I googled and saw some techniques that > > > require writing code. > > > Could I just GET the docs with curl and then PUT them? > > > > > > The fastest way is probably > > > 1. Create a new database > > > 2. GET the design docs, PUT them to the new database > > > 3. Delete the old database > > > However you=92ll be left with a database with a different name. I don= =92t > > > think there is any API to rename a database. > > > > > > =97Jens > > > > --f46d0438914b47b5a304d8c72ce4--