This page shows you how to convert a free starter index in the gcp-starter environment to a serverless index.

Before you begin

Make sure your starter index is in the gcp-starter environment.

1. Pause traffic to the index

Converting your index to serverless can take up to 30 minutes. During that time, writes to the gcp-starter index will not be reflected in the new serverless index, so it’s recommended to pause client traffic to the gcp-starter index before starting conversion.

2. Update SDKs

If you are using an older version of the Python, Node.js, Java, or Go SDK, you must update the SDK to work with serverless indexes.

  1. Check your SDK version:

  2. If your SDK version is less than 3.0.0 for Python, 2.0.0 for Node.js, 1.0.0 for Java, or 1.0.0 for Go, upgrade the SDK as follows:

    If you’re using the .NET SDK, add a package reference to your project file:

    C#
    dotnet add package Pinecone.Client 
    

3. Adapt existing code

You must make some minor code changes to work with serverless indexes.

  1. Change how you import the Pinecone library and authenticate and initialize the client:

  2. Listing indexes now fetches a complete description of each index. If you were relying on the output of this operation, you’ll need to adapt your code.

    The list_indexes operation now returns a response like the following:

  3. Describing an index now returns a description of an index in a different format. It also returns the index host needed to run data plane operations against the index. If you were relying on the output of this operation, you’ll need to adapt your code.

  4. Serverless indexes do not support the following features. If you were relying on these features for your legacy starter index, you’ll need to adapt your code.

Depending on your usage of the SDK, there may be other changes to make. For a comprehensive list, see the Python SDK v3 migration guide, Node.js SDK v2 migration guide, or Java SDK v1 migration guide.

4. Convert the index

In the Pinecone console, go to your starter index and click Convert to serverless.

The process takes less than 5 minutes and does not involve creating or deleting any indexes; instead, this process transforms your starter index into a serverless index and moves it to the us-east-1 region of the AWS cloud.

5. Reinitialize clients

Once your index has been converted to serverless, your index will have a new DNS host.

  • If you are using Pinecone SDKs, reinitialize your clients so they pick up the new index host.

  • If you are using the REST API directly, get the new index host and use it in all data plane requests:

    curl
    PINECONE_API_KEY="YOUR_API_KEY"  
    INDEX_HOST="INDEX_HOST"  
    curl -X POST "https://$INDEX_HOST/describe_index_stats" \  
        -H "Api-Key: $PINECONE_API_KEY" \
        -H "X-Pinecone-API-Version: 2024-07"
    

See also

Was this page helpful?