Space clone: assets issue

Hi there.

I’ve cloned a space and there is an issue with assets.

This is the script:

let fileName = `export_mm7bfysjbulb_${moment().format('x')}.json`
    spaceId: "mm7bfysjbulb",
    managementToken: accessToken,
    useVerboseRenderer: true,
    errorLogFile: 'error.json',
    saveFile: false,
    includeDrafts: true
}).then(output => {
      path.join(__dirname, '../exports', fileName),
return spaceImport({
    spaceId: "niuyvdh3hcjp",
    managementToken: accessToken,
    contentFile: path.join(__dirname, '../exports', fileName),
    contentModelOnly: false,
    skipLocales: false,
    errorLogFile: 'error.json'

All content types, entries, roles, etc etc are imported.

But when I open an asset in the web app, it’s still in “processing” state:

The asset entry has “strange” data:

"fields": {
    "title": {
      "it-IT": "1000x1000"
    "file": {
      "it-IT": {
        "upload": "",
        "fileName": "1000x1000.jpg",
        "contentType": "image/jpeg"

where mm7bfysjbulb is the source spaceId. The problem is only with draft assets.

The two spaces have the same default locale.

Hey @vmilone,

The problem is only with draft assets.

This does mean they’ve never been published by now, right?
From what I know, those assets are not available at the endpoint, until they are published.

Have you tried setting the downloadAssets option to true?


1 Like

Hi Stephan,

draft assets are already on Contentful CDN, so there isn’t any problem to reach them:

For example the 2SwkwbcFtegyygakCOkEAU asset is draft:

hey @vmilone,
Khaled here the maintainer of the import and export tools.
The import tool tends to import data as is, so if an asset is draft in your source space it will be imported as draft to your destination space.
But maybe we should actually still keep the asset in draft but process it to avoid that broken bhaviour.
I’ll see what I can do.

1 Like

Hi @khaled

This is an huge issue for us, we have 7 different spaces and I must publish assets
before I can clone one space to another.


Hi @vmilone,
This is actually fixed, in the @next version
If you npm i contentful-import@next you should get the fixed version. You can work with that for now until we make a final release.


1 Like

Hi @khaled,

I’ve tried with contentful-import@5.0.1 but unfortunately the problem is the same.

It’s possible that I’m doing something wrong? I must update contentful-export?

Hi @vmilone,

Have you also tried it with next version? next is the name of latest beta version.
So, you can get it like Khaled mentioned earlier: npm i contentful-import@next

Hey @vmilone,

Benedikt here, one of our JS tooling maintainers.

Sorry for the confusion, we just found out, that we actually did not merge the bugfix into the next branch.

We are currently reviewing the branch and will publish a new beta version today or tomorrow including the bugfix.

I keep u posted here.

All the best,

1 Like

Hi @benedikt,

thank you for the support.

1 Like

Hi @benedikt,

Is there any update?

Hi @vmilone,

Sorry for that!
We’re very busy releasing main JS SDK and unfortunately, had no time to tackle this issue with import tool. Apologize for the inconvenience!
We’re doing our best to make this happen very soon, but I don’t want to give you false promises (simply because of other urgent issues). We don’t have strict milestone for releasing new import version, but, again, hopefully it’s gonna happen soon.

Hey @vmilone,

I got good news. We were able to merge the branch which includes the bugfix, I upgraded the tool to use the latest SDK version and released a new beta version.

Just download it via npm install -g contentful-import@next

Besides of sweeter output, it should also now process draft assets. Please let me know if that worked now for you.

All the best,

1 Like

Hi @benedikt

I’ve installed 5.0.2-beta1 version and then I launched my scripts. Some of assets are correctly uploaded and processed but during the “Import assets” task the script crashed.

Here is the full error message:

If you want I can share with you the export file that I’m trying to import.

Hi @vmilone,

Yes, could you please send us the export file? I kindly ask you to move this conversation to our official support channel in order to keep files safe and as further investigation is required.
Could you please send us details and the export file at or via Submit ticket form: ?

Thanks a lot and once again sorry for the inconvenience!:cry:

Hi @andrey,

You have right! I’ve opened a support ticket.


1 Like

@vmilone excellent! Thank you very much. Received it.

Did anything come out of this effort? I’m seeing the exact same problem now. I can re-export and import using the new libraries but I’d like some insight.

Hi @dustin.aleksiuk,

the issue is resolved by contentful-import@5.0.2-beta2

You can install it with

npm install contentful-import@next


1 Like

Thank you @vmilone!
@dustin.aleksiuk correct, the issue should be fixed. Let me know if still see the problem.