couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "BreakingChanges" by ChristopherLenz
Date Mon, 26 May 2008 20:10:10 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The following page has been changed by ChristopherLenz:
http://wiki.apache.org/couchdb/BreakingChanges

The comment on the change is:
Some documentation for dump/load with couchdb-python

------------------------------------------------------------------------------
  
  === Database File Format ===
  
- The database file format has changed. CouchDB itself does yet not provide any tools for
migrating your data. In the meantime, you can use third-party scripts to deal with the migration,
such as the dump/load tools that come with the development version (trunk) of couchdb-python.
+ The database file format has changed. CouchDB itself does yet not provide any tools for
migrating your data. In the meantime, you can use third-party scripts to deal with the migration,
such as the dump/load tools that come with the development version (trunk) of [http://code.google.com/p/couchdb-python/
couchdb-python].
  
- '''TODO: Link and/or Documentation'''
+ ==== Migration Using the couchdb-python `dump`/`load` Tools ====
+ 
+ First, some important notes on the way these tools operate:
+  * They work on a per-database basis, meaning you'll need to migrate all databases individually.
+  * The dump tool retrieves all documents, including attachments, from a database and writes
them to standard output in MIME multipart format.
+  * The load tool expects that MIME multipart on the standard input stream, and recreates
all the documents (including attachments) it contains. It should be used with an empty target
database.
+  * Documents of course retain their unique identifiers.
+  * The revision history of the documents is completey discarded.
+ 
+ '''Note''': ''Do not upgrade CouchDB until you've gotten your data out using the procedure
described below!''
+ 
+ '''Also note''': ''Please keep backups of both the original database files and the dump
files, at least until you've verified that the migration worked completely.''
+ 
+ To use the tools, you'll have to install `couchdb-python` (currently from trunk), which
in turn requires [http://www.python.org/ Python 2.4] and the [http://code.google.com/p/httplib2/
httplib2] and [http://cheeseshop.python.org/pypi/simplejson simplejson] packages.
+ 
+ On the shell, enter the directory into which you checked out the `couchdb-python` code.
First run to make sure the package is installed:
+ 
+ {{{
+   ./setup.py install
+ }}}
+ 
+ Now, to dump the contents of a particular database into a file, run the following command:
+ 
+ {{{
+   python couchdb/tools/dump.py http://127.0.0.1:5984/dbname > dbname.dump
+ }}}
+ 
+ Replace '''dbname''' with the name of the database to dump. This will create a file called
`dbname.dump` in the current directory.
+ 
+ After you've done this for all the databases you want to migrate, you can upgrade CouchDB.
You will need to completely clear the directory where CouchDB stored the old databases, as
it will probably choke on files using the old format.
+ 
+ After the upgrade you can import all the data you previously exported. First, you'll need
to create an empty database for every database dump you want to import. Then you execute the
`load.py` script from the command-line as follows:
+ 
+ {{{
+   python couchdb/tools/load.py http://127.0.0.1:5984/dbname < dbname.dump
+ }}}
+ 
+ Do that for all your databases, and you should be set. Please report any bugs in those scripts
[http://code.google.com/p/couchdb-python/issues/list here].
  
  === Document Structure Changes ===
  

Mime
View raw message