31

I've got couchdb installed from a package manager (Ubuntu, 10.04), but the partition where couchdb is installed is not especially big (~5GB). I'd like to move the database files to a bigger partition I set aside for the db, but I can't seem to find how to do it anywhere.

I suspect it's a local.ini tweak, but I've got nothing to back that up.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
FTWynn
  • 1,349
  • 2
  • 11
  • 11

3 Answers3

39

That is in local.ini

[couchdb]
database_dir = /path/to/the/databases
view_index_dir = /path/to/the/views

Good luck!

Steve Greatrex
  • 15,789
  • 5
  • 59
  • 73
JasonSmith
  • 72,674
  • 22
  • 123
  • 149
  • Just what I'm looking for. Thanks! Is there a comprehensive doc with these somewhere I overlooked? – FTWynn Jun 11 '11 at 08:26
  • 2
    I suppose a charitable answer is, the .ini files are self-documenting. – JasonSmith Jun 11 '11 at 08:35
  • 1
    *Smack forehead* Turns out I looked everywhere but the default.ini file. Awesome. – FTWynn Jun 13 '11 at 07:56
  • this is an old question, I know, but did that really work for you? i can't get couchdb to write to my specified directories-- it still insists on writing to /var/lib no matter what the local.ini says... – Harlo Holmes Jun 05 '12 at 19:54
  • Hi, Harlo. CouchDB can read *multiple* config files in a series, each one overriding the config of the one before (sort of like CSS). So make sure you are editing the *final* file in that sequence (by default, `local.ini`.) Also, you can try using the `/_config/` API. If you have more problems, create a Server Fault question and we'll figure it out there. – JasonSmith Jun 06 '12 at 00:06
  • if you are moving items / linking items, you have to create the .databasename_view directory with the proper owner / group first, or the view wont generate. Couchdb 1.6.1 – Nick May 06 '16 at 06:14
  • is it `default.ini` or `local.ini`? – WCMC Dec 15 '18 at 17:22
7

You could also take advantage of symbolic linking. Move the contents of /var/lib/couchdb into your desired directory, and create a symbolic link. Be sure to give the couchdb user permissions to the symlink.

Harlo Holmes
  • 5,145
  • 1
  • 23
  • 20
0

Here is the documentation for Couchdb 3.2.2:

https://docs.couchdb.org/en/3.2.2-docs/config/intro.html

Here is what worked for me in Ubuntu:

  1. Stop the couchdb service

    sudo service couchdb stop

  2. Modify the default.ini file

    sudo vi /opt/couchdb/etc/default.ini

Lines to modify:

[couchdb]
database_dir = {new location}
view_index_dir = {new location}
  1. Copy the data

sudo rsync -av /opt/couchdb/data/ {new location}

  1. Restart and check the service

    sudo service couchdb start

    sudo service couchdb status