---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/jobs](../index.md) / siteArchiveImportSplit

# Function: siteArchiveImportSplit()

> **siteArchiveImportSplit**(`instance`, `dir`, `options`): `Promise`\<[`SiteArchiveImportResult`](../interfaces/SiteArchiveImportResult.md)[]\>

Defined in: [packages/b2c-tooling-sdk/src/operations/jobs/site-archive.ts:770](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/9c8c448223735b087738106fca3bc4c8e812ceb7/packages/b2c-tooling-sdk/src/operations/jobs/site-archive.ts#L770)

Imports a large site archive by splitting it into multiple archive parts that
each stay under a size ceiling, then importing them sequentially.

This works around the instance-side limit on a single import archive. The
strategy:
1. **Order-sensitive XML/metadata** is imported first, kept together in one
   archive when it fits (preferred). If it must be split, it splits at
   top-level data-unit boundaries in dependency order, never splitting a
   single unit — so catalogs (and their internal references) ride together.
2. **Static assets** (catalog/library static resources) are deferred to
   subsequent archive parts, bin-packed by compressed size. They are
   order-independent and attach to the units created by the XML import.

Parts are imported sequentially and the operation stops on the first failure.

## Parameters

### instance

[`B2CInstance`](../../../instance/classes/B2CInstance.md)

B2C instance to import to

### dir

`string`

Local directory to import (must be a directory)

### options

[`SiteArchiveImportSplitOptions`](../interfaces/SiteArchiveImportSplitOptions.md) = `{}`

Split import options

## Returns

`Promise`\<[`SiteArchiveImportResult`](../interfaces/SiteArchiveImportResult.md)[]\>

One import result per archive part, in import order

## Throws

Error if a single file or data unit cannot fit under `maxBytes`

## Throws

JobExecutionError if any part's import job fails

## Example

```typescript
const results = await siteArchiveImportSplit(instance, './big-site-data', {
  maxBytes: 190 * 1024 * 1024,
  onPart: (p) => console.log(`Part ${p.index}/${p.total}: ${p.kind} (${p.fileCount} files)`),
});
```
