Skip to main content
Pinecone Docs

Search documentation

Type to search this documentation.

On this pageOverview

Back up a pod-based index

Legacy guide for backing up Pinecone pod-based indexes using collections. Collections are a pod-only feature not available for serverless indexes.

This page describes how to create a static copy of a pod-based index, also known as a collection.

To create a backup of your pod-based index, use the create_collection operation.

The following example creates a collection named example-collection from an index named docs-example:

Python
# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as Pinecone

pc = Pinecone(api_key="API_KEY")
pc.create_collection("example-collection", "docs-example")
JavaScript
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone'

const pc = new Pinecone({
  apiKey: 'YOUR_API_KEY'
});

await pc.createCollection({
  name: "example-collection",
  source: "docs-example",
});
Java
import io.pinecone.clients.Pinecone;

public class CreateCollectionExample {
    public static void main(String[] args) {
        Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();

        pc.createCollection("example-collection", "docs-example");
    }
}
Go
package main

import (
    "context"
    "fmt"
    "log"

    "github.com/pinecone-io/go-pinecone/v4/pinecone"
)

func main() {
    ctx := context.Background()

    pc, err := pinecone.NewClient(pinecone.NewClientParams{
        ApiKey: "YOUR_API_KEY",
    })
    if err != nil {
        log.Fatalf("Failed to create Client: %v", err)
    }

    collection, err := pc.CreateCollection(ctx, &pinecone.CreateCollectionRequest{
        Name: "example-collection", 
        Source: "docs-example",
    })
    if err != nil {
        log.Fatalf("Failed to create collection: %v", err)
    } else {
        fmt.Printf("Successfully created collection: %v", collection.Name)
    }
}
curl
PINECONE_API_KEY="YOUR_API_KEY"

curl -s POST "https://api.pinecone.io/collections" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "X-Pinecone-Api-Version: 2025-10" \
  -d '{
        "name": "example-collection",
        "source": "docs-example"
  }'

To retrieve the status of the process creating a collection and the size of the collection, use the describe_collection operation. Specify the name of the collection to check. You can only call describe_collection on a collection in the current project.

The describe_collection operation returns an object containing key-value pairs representing the name of the collection, the size in bytes, and the creation status of the collection.

The following example gets the creation status and size of a collection named example-collection.

Python
# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as Pinecone

pc = Pinecone(api_key='API_KEY')
pc.describe_collection(name="example-collection")
JavaScript
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone';

const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' });

await pc.describeCollection('example-collection');
Java
import io.pinecone.clients.Pinecone;
import org.openapitools.client.model.CollectionModel;

public class DescribeCollectionExample {
    public static void main(String[] args) {
        Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
        CollectionModel collectionModel = pc.describeCollection("example-collection");
        System.out.println(collectionModel);
    }
}
Go
package main

import (
    "context"
    "fmt"
    "log"

    "github.com/pinecone-io/go-pinecone/v4/pinecone"
)

func main() {
    ctx := context.Background()

    pc, err := pinecone.NewClient(pinecone.NewClientParams{
        ApiKey: "YOUR_API_KEY",
    })
    if err != nil {
        log.Fatalf("Failed to create Client: %v", err)
    }

    collectionName := "example-collection"

    collection, err := pc.DescribeCollection(ctx, collectionName)
    if err != nil {
        log.Fatalf("Error describing collection %v: %v", collectionName, err)
    } else {
        fmt.Printf("Collection: %+v", collection)
    }
}
curl
PINECONE_API_KEY="YOUR_API_KEY"

curl -i -X GET "https://api.pinecone.io/collections/example-collection" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-Api-Version: 2025-10"

To get a list of the collections in the current project, use the list_collections operation.

Python
from pinecone.grpc import PineconeGRPC as Pinecone

pc = Pinecone(api_key='API_KEY')
pc.list_collections()
JavaScript
import { Pinecone } from '@pinecone-database/pinecone'

const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })

await pc.listCollections();
Java
import io.pinecone.clients.Pinecone;
import org.openapitools.client.model.CollectionModel;

public class ListCollectionsExample {
    public static void main(String[] args) {
        Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
        List<CollectionModel> collectionList = pc.listCollections().getCollections();
    }
}
Go
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "log"

    "github.com/pinecone-io/go-pinecone/v4/pinecone"
)

func prettifyStruct(obj interface{}) string {
    bytes, _ := json.MarshalIndent(obj, "", "  ")
    return string(bytes)
}

func main() {
    ctx := context.Background()

    pc, err := pinecone.NewClient(pinecone.NewClientParams{
        ApiKey: "YOUR_API_KEY",
    })
    if err != nil {
        log.Fatalf("Failed to create Client: %v", err)
    }

    collections, err := pc.ListCollections(ctx)
    if err != nil {
	    log.Fatalf("Failed to list collections: %v", err)
    } else {
        if len(collections) == 0 {
            fmt.Printf("No collections found in project")
        } else {
            for _, collection := range collections {
                fmt.Printf("collection: %v\n", prettifyStruct(collection))
            }
        }
    }
}
curl
PINECONE_API_KEY="YOUR_API_KEY"

curl -i -X GET "https://api.pinecone.io/collections" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "X-Pinecone-Api-Version: 2025-10"

To delete a collection, use the delete_collection operation. Specify the name of the collection to delete.

Deleting the collection takes several minutes. During this time, the describe_collection operation returns the status "deleting".

Python
# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as Pinecone

pc = Pinecone(api_key='API_KEY')
pc.delete_collection("example-collection")
JavaScript
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone'

const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })

await pc.deleteCollection("example-collection");
Java
import io.pinecone.clients.Pinecone;

public class DeleteCollectionExample {
    public static void main(String[] args) {
        Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
        pc.deleteCollection("example-collection");
    }
}
Go
package main

import (
    "context"
    "fmt"
    "log"

    "github.com/pinecone-io/go-pinecone/v4/pinecone"
)

func main() {
    ctx := context.Background()

    pc, err := pinecone.NewClient(pinecone.NewClientParams{
        ApiKey: "YOUR_API_KEY",
    })
    if err != nil {
        log.Fatalf("Failed to create Client: %v", err)
    }

    collectionName := "example-collection"

    err = pc.DeleteCollection(ctx, collectionName)
    if err != nil {
	    log.Fatalf("Failed to delete collection: %v\n", err)
    } else {
        if len(collections) == 0 {
            fmt.Printf("No collections found in project")
        } else {
            fmt.Printf("Successfully deleted collection \"%v\"\n", collectionName)
        }
    }
}
curl
PINECONE_API_KEY="YOUR_API_KEY"

curl -i -X DELETE "https://api.pinecone.io/collections/example-collection" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "X-Pinecone-Api-Version: 2025-10"
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu