Convert a gcp-starter index to serverless
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.
-
Check your SDK version:
-
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#
3. Adapt existing code
You must make some minor code changes to work with serverless indexes.
-
Change how you import the Pinecone library and authenticate and initialize the client:
-
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: -
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.
-
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.
-
- Instead, you can delete records by ID prefix.
-
- Because high-cardinality metadata in serverless indexes does not cause high memory utilization, this operation is not relevant.
-
- Because serverless indexes scale automatically based on usage, this operation is not relevant
-
- This feature is available on AWS only.
-
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
See also
Was this page helpful?