Proper procedure for changing database_dir value on single node couchbase server

I’m trying to put together a script to install a single node couchbase server but modfiy the data directory. After I install, via the msi I do the following:

  1. Initialize the cluster
  2. Stop couchbaseserver service.
  3. Change the database_dir value in C:\Program Files\Couchbase\Server\etc\couchdb\default.d\capi.ini
  4. Change the database_dir value in C:\Program Files\Couchbase\Server\etc\couchdb\default.ini
  5. Restart couchbase server

I do this via a powershell script, which runs successfully (i.e. ini files have the proper values changed) but when I log into the couchbase server web dashboard the server does not show the new path to the data directory.

I have occasionally had success modifying the capi.ini manually, and restarting couchbase server service but when running from a script it never works.

Does anyone know the correct steps to change the data directory? Do I modify capi.ini & default.ini? I only modify one of those files? there another file that needs to be modified?

Any help is greatly appreciated.