Pinecone TypeScript SDK - v9.2.0
    Preparing search index...

    Class Backups

    Backups preserve index data for restoration into a new index. Access them through Pinecone.backups; do not construct this class directly. Use Collections for snapshots of pod-based indexes.

    import { Pinecone } from '@pinecone-database/pinecone';

    const pc = new Pinecone();
    const backups = await pc.backups.list();
    Index
    • Starts creating a backup of an index.

      Parameters

      • indexName: string

        The index to back up, such as product-catalog.

      • Optionaloptions: CreateBackupResourceOptions

        An optional name and description to help identify the backup.

      Returns Promise<BackupModel>

      The backup ID, source index, and current status; creation can still be in progress.

      Errors.PineconeArgumentError when the index name is empty.

      import { Pinecone } from '@pinecone-database/pinecone';

      const pc = new Pinecone();
      const backup = await pc.backups.create('product-catalog', {
      name: 'catalog-weekly',
      description: 'Before the autumn catalog refresh',
      });
      console.log(backup.backupId, backup.status);
    • Starts restoring a backup into a new index.

      Use RestoreJobs.describe to check progress after this call returns.

      Parameters

      • backupId: string

        The ID of the backup to restore.

      • options: CreateIndexFromBackupResourceOptions

        The new index name and optional tags, deletion protection, read capacity, and deployment. Set deployment to restore a serverless backup into another region of the same cloud.

      Returns Promise<CreateIndexFromBackupResponse>

      The restoreJobId for tracking progress and indexId of the new index.

      Errors.PineconeArgumentError when the backup ID or new index name is empty, or when deployment.deploymentType is not managed or byoc.

      import { Pinecone } from '@pinecone-database/pinecone';

      const pc = new Pinecone();
      const result = await pc.backups.createIndex(
      '11450b9f-96e5-47e5-9186-03f346b1f385',
      { name: 'product-catalog-restored' },
      );
      const job = await pc.restoreJobs.describe(result.restoreJobId);
      console.log(job.status);

      Indexes.create to create an empty index.

    • Deletes a backup.

      Deletion is asynchronous; the backup may remain visible briefly after this call returns.

      Parameters

      • backupId: string

        The ID of the backup to delete.

      Returns Promise<void>

      Resolves when the deletion request is accepted.

      Errors.PineconeArgumentError when the backup ID is empty.

      import { Pinecone } from '@pinecone-database/pinecone';

      const pc = new Pinecone();
      await pc.backups.delete('11450b9f-96e5-47e5-9186-03f346b1f385');
    • Retrieves the configuration and status of a backup.

      Parameters

      • backupId: string

        The ID returned when the backup was created or listed.

      Returns Promise<BackupModel>

      The backup ID, source index, and current status.

      Errors.PineconeArgumentError when the backup ID is empty.

      import { Pinecone } from '@pinecone-database/pinecone';

      const pc = new Pinecone();
      const backup = await pc.backups.describe('11450b9f-96e5-47e5-9186-03f346b1f385');
      console.log(backup.status);
    • Lists one page of backups across the project.

      Parameters

      • Optionaloptions: ListProjectBackupsOptions

        Page size and continuation token. Omit to fetch the first page with the default size.

      Returns Promise<BackupList>

      The backups in data; pass pagination.next as paginationToken to fetch the next page.

      import { Pinecone } from '@pinecone-database/pinecone';

      const pc = new Pinecone();
      const page = await pc.backups.list({ limit: 10 });
      console.log(page.data, page.pagination?.next);

      Backups.listByIndex to list backups for a named index.

    • Lists one page of backups for an index.

      Parameters

      • indexName: string

        The source index name, such as product-catalog.

      • Optionaloptions: ListIndexBackupsOptions

        Pagination settings; set includeDeleted to include backups of deleted indexes with this name.

      Returns Promise<BackupList>

      The backups in data; pass pagination.next as paginationToken to fetch the next page.

      Errors.PineconeArgumentError when the index name is empty.

      import { Pinecone } from '@pinecone-database/pinecone';

      const pc = new Pinecone();
      const page = await pc.backups.listByIndex('product-catalog', { limit: 10 });
      console.log(page.data, page.pagination?.next);

      Backups.list to list backups across the project.