A newer version of this documentation is available.

View Latest

Import a Repository

      A repository that continues to exist on disk, but has been deleted from the Backup Service, can be imported back into the Backup Service.

      HTTP Methods and URIs

      POST /cluster/self/repository/import


      Imports into the Backup Service of the host cluster a repository that was previously deleted, but which has continued to exist on disk, in a location accessible by the cluster’s Backup-Service nodes.

      Curl Syntax

      curl -X POST http://<backup-node-ip-address-or-domain-name>:8097/cluster/self/repository/import
        -u -u <username>:<password>
        -d <repository-specification>

      The username and password must be those of a user with the Full Admin role. The repository-specification must be a JSON document that provides the following:

      • The id under which the repository was saved to disk. For example, quarterHourBackups.

      • The name of the repository. For example, 5efb4b57-b033-4e84-9671-a35a0ac6dace.

      • The location of the repository. For example, /Users/user/Documents/archives/quarterHourRepo.

      Syntactically, the repository-specification is as follows:

        "id": <repository-id>,
        "repo": <repository-name>,
        "archive": <repository-location>


      Success returns 200 OK. An improperly formatted repository-specification returns 400 Bad Request, and a message such as the following: {"status":400,"msg":"both archive and repository are required"}. An otherwise malformed URI returns 404 Object Not Found.

      Failure to authenticate returns 401 Unauthorized. An internal error that prevents return or modification of the limits returns 500 Internal Server Error.


      The following call imports into the Backup Service the repository located at /Users/user/Documents/archives/quarterHourRepo:

      curl -X POST \
      -u Administrator:password \
      -d '{"id":"quarterHourRepo","repo":"5efb4b57-b033-4e84-9671-a35a0ac6dace","archive":"/Users/user/Documents/archives/quarterHourRepo"}'

      Success returns 200 OK, and the repository is imported into the Backup Service.

      See Also

      An overview of the Backup Service is provided in Backup Service. A step-by-step guide to using Couchbase Web Console to configure and use the Backup Service is provided in Manage Backup and Restore. For information on archiving a repository, see Archive a Repository. For information on deleting a repository from the Backup Service, see Delete a Repository.