better handling of textarea to richText field conversion #664
Replies: 1 comment 4 replies
-
Hey @MinSomai — yes, if you have old string-based data saved in a field, you'll need to migrate your old textarea field data to the JSON format that the RichText field stores. You can write a migration script using the Payload Local API to find all documents with old textarea data, and then update each one to use the new data shape. Here is an example of a seed script that we are using in our public demo, which you could modify to migrate your old data to your new shape: https://github.com/payloadcms/public-demo/blob/master/src/cron/reset.ts You'd basically need to take data like this:
and change it the RichText JSON format like this:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I had a textarea field which I had to change to richText because I wanted links. And because I had previous values in that same
name
. The admin goes white and show nothing.Beta Was this translation helpful? Give feedback.
All reactions