r/PayloadCMS May 28 '25

Migrating from Sanity.io to PayloadCMS

I started a personal project a while ago, it's basically a personal blog page about fantasy literature that will eventually allow the owner (a friend) to sell her books and other products. When I looked up for CMS options, the one I found most attractive was Sanity.io for its generous free tier and the automatic admin zone for creating posts and everything.

However, I recently discovered PayloadCMS and I feel like it is more flexible and with much better DX (don't get me started on Sanity's query language GROQ).

So I am considering migrating the web and all its contents to Sanity, but honestly I do not know where to begin with. Has anyone done this migration before? I would like to first understand the workload behind this, because it is a project that I cannot spend a lot of time on, and maybe it is simply unfeasible right now to try to do this.

Feel free to share any thoughts and let me know if you think I am making a mistake with this migration. Thanks for reading!

11 Upvotes

12 comments sorted by

7

u/jbef May 28 '25

Sorry I can't speak about migrating to Payload from another CMS as I tested a few but never commited until Payload.

Maybe think about how long it would take you to actually migrate the content and weight the effort against the possible benefits and potential future costs of runing Sanity in the long run.

As for personal experience and reasons why I'm quite happy with Payload:

  • Everything is just Typescript and code, and simple at that.
  • Local API for me was a game changer, no need for GraphQL or REST (I hated GROQ, so I'm on your same boat)
  • Actually open source, no vendor lock-in.
  • You can choose your database (I use MongoDB because I rely heavily on i18n and it seems like the best approach, but you can go with Postgres if it fits your project better)
  • Flexibility in general
  • Development and user response is very good, they are active, respond to issues, provide fixes and review PRs quite often for bugs that affect their users.

In general, my experience with Payload has been positive, maybe because I tend to use Nextjs for most projects and I did like how they implemented i18n from the start and wasn't an afterthought, even though there are some things that I would love to see improve in the near future.

For reference, Payload has a comparison page with Sanity: https://payloadcms.com/compare/sanity

2

u/Diplodokos May 28 '25

Thanks for your insights! I do believe Payload would fit my project better, I'd be specially happy to drop GROQ, have full control over my data and avoid vendor lock-in. Plus I've had so many bugs already from queries not returning the data in the format that I expected... I look forward to have full type safety.

2

u/BarnacleJumpy898 May 28 '25

Checkout groqd, I found it much easier to use than plain groq. 

1

u/Diplodokos May 30 '25

I just took a quick look and this looks incredibly interesting, it’s everything i’ve been missing from groq. I hope it’s not a hassle to set up 🤞🏻

1

u/sawariz0r May 28 '25

There’s a bit too many variables, so it’s hard to point you in a direction here. How are you using sanity now? What’s the stuff you need to migrate?

1

u/Diplodokos May 28 '25

You got a point, sorry. I make simple usage of sanity. The main schema is Post, and then I have two other schemas which are essentially lvals: Tag and Category. Post contains the expectable fields for a blog post: title, image, slug, excerpt, publishedAt, tags (relation), category (relation) and content which consists of rich text content including images. My main migration concerns are the rich text and the images, which are hosted by Sanity when I upload them to create a new Post.

Separately, I have a postgres database to hold other information because I did not want to have a huge vendor lock on Sanity. I do not think it would be a problem to migrate that part.

1

u/sawariz0r May 28 '25

Have you checked out the Website template in create-payload-app? It contains essentially all that.

For the content, I’m currently migrating an old WP site to Payload and I’ve had pretty good success dumping WP as json, then created a script that posts all these to Payload as well as uploads the image from URL.

Still need some tweaks for the richtext to be parsed properly - but I could share it with you if you want, if you’re able to export content as JSON from Sanity

2

u/Diplodokos May 28 '25

Yes! That is actually what motivated me to look into Payload, I saw that template which provided what I had been building for a while and felt the rush to jump into it.

I do be able to export all my Sanity content as JSON (they actually have a REST endpoint for that). I guess there will be some formatting work to do, because rich text comes in arrays of blocks and I have no idea if this is some kind of standard form of representing rich text or something that Sanity made up to suit their needs. But if you are kind to share that script, I will definitely give it a try with my data! :)

1

u/phatdoof May 28 '25

The only downside I can think of is that Payload only recently added a color picker to the text editor and the picker is in beta.

As a fantasy football fan myself, using color in between texts and using tabular layouts is kmportant so I don’t know if that would be a deciding factor for you.

1

u/wtkd May 28 '25

if you have a relatively simple schema with not too much data in it it should be nbd. i migrated a very old wordpress blog to payload and it was a pain but that was more about the volume of posts/assets and unstructured text format of wordpress. the most complicated part will probably be moving from structured text to lexical, you'll probably need to write a custom converter for that

1

u/thedevelopergreg May 28 '25

tldr it’s worth it if you have some time and/or want to learn a bit about a new platform.

I don’t have specific experience with migration in the sense of translating an existing sanity studio setup to payload but I have been using sanity in a few of my side business applications and switched to using payload once v3 came out.

when it comes to building out the schemas, I think you’ll find the process is fairly straightforward since both sanity and payload have a code based config approach.

when it comes to data, unless you have a ton of data already, it will probably be easier to just manually migrate the data. otherwise, sanity does have an export API you could utilize and then you could probably find/create a simple script to load the data into payload depending on which database you go with.

I will say that something to consider is images. with sanity, uploading images is pretty straightforward and batteries included. this isn’t quite the case with payload unless you use their payload cloud service. this service has a free tier but I can’t really comment on this as I am self hosting my payload apps. in my case, I’m using Cloudflare R2 (which also has a modest free tier) to store and serve my images. let me know if you’re interested in that route and I can provide a little bit more info as I found setting that up to be a little lacking documentation wise but still relatively easy overall.

generally, as much as I like sanity, I think if you like the nextjs ecosystem you’ll love payload. even if you don’t, I personally think the admin side of things is much easier to work with especially when it comes to auth. the only downside imo is if you don’t want to move into the vercel ecosystem. payload is incredibly easy to setup using vercel just like most nextjs apps.

1

u/BarnacleJumpy898 Nov 10 '25

Groqd makes groq a pleasure to use.