👋 Next.js Conf 2024: Come build, party, run, and connect with us! See all events

Error importing data into Sanity project due to outdated CLI version

7 replies
Last updated: Jun 23, 2023
I'm in the process of merging two sanity projects together. I've moved the schemas and components ++ into a new project, and it is working fine. Now I want to migrate the data from the old projects into the new one. I managed to export it into a .ndjson file according to this documentation , now I try to follow the import steps found here , but I get the following error when I try:
Error: Command "dataset" is not available outside of a Sanity project context.
Run the command again within a Sanity project directory, where "@sanity/core"
is installed as a dependency.
As far as I can understand @sanity/core is a v2 package, right? Is there another way to do imports in v3?
Jun 20, 2023, 11:00 AM
Has anyone done anything similar and can point me in the right direction?
Jun 22, 2023, 6:44 AM
If it’s a v3 project make sure you have a
sanity.cli.json
file
Jun 22, 2023, 9:17 AM
Do you mean sanity.cli.js / sanity.cli.ts?
Jun 22, 2023, 9:18 AM
Ah yes, sorry. Sounds like you might already have it?
Jun 22, 2023, 12:19 PM
I do, so I don't think that's the problem. But thanks for trying
Jun 22, 2023, 12:20 PM
It looks like you have V2 of the CLI installed.
Jun 22, 2023, 4:50 PM
Thank you! That was the issue. I updated the client and was able to import the dataset 😊
Jun 23, 2023, 6:04 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?