pnp / sp-dev-fx-webparts

SharePoint Framework web part, Teams tab, personal app, app page samples
http://aka.ms/spfx-webparts
MIT License
2.05k stars 3.86k forks source link

js-advanced-commenting Migrate existing comments (programmatically) #5352

Open sanjeevba opened 5 days ago

sanjeevba commented 5 days ago

Disclaimer

Yes

Sample

js-advanced-commenting

Contributor(s)

@hugoabernier

Question

Hi Hugo, I'm migrating a legacy web app to SPO and I would like to migrate existing comments. Is there an easy way to do this? I imagine your webpart stores everything in a SP list.? Would I just programmatically load data into that list?

Sanjeev

sanjeevba commented 1 day ago

Hi @sudharsank,

Would you be to able answer my question above?

Or maybe @wideserg, @a1mery?

Sanjeev

a1mery commented 7 hours ago

Hello @sanjeevba ,

This is a complex question ;) You could indeed load your existing data in the SharePoint list used by the web part. But I guess the complex part would be to update your data architecture so that your legacy data (source data) matches the data architecture required by the web part.

sanjeevba commented 10 minutes ago

Hi @a1mery,

I don't quite understand why I'd have to 'update my data architecture'. The only fields I'd be migrating would be: Comment txt, Author, and Created date.

I was hoping I could look at an existing list item created by the web part and programmatically create additional (similar) list items for the migrated comments.

Sanjeev

sudharsank commented 5 minutes ago

Hi Sanjeev,

Below is the schema that is used for Modern Comments. When you migrate the existing comments, you should update the other fields as well with the correct values and also if you have any replies, the parent and the child should be mapped correctly.

      "id": "c4", "parent": null, "created": "2023-06-24T10:52:45.584Z", "modified": "2023-06-24T10:52:45.584Z", "content": "sd fsd ds fd", "pings": {}, "fullname": "Sudha", "profile_picture_url": @.***", "created_by_current_user": false, "upvote_count": 0, "user_has_upvoted": false, "userid": 7

I hope the above clarifies your question.

Thanks, Sudharsan


From: sanjeevba @.> Sent: Thursday, November 28, 2024 10:42 PM To: pnp/sp-dev-fx-webparts @.> Cc: Sudharsan Kesavanarayanan @.>; Mention @.> Subject: Re: [pnp/sp-dev-fx-webparts] js-advanced-commenting Migrate existing comments (programmatically) (Issue #5352)

Hi @a1meryhttps://github.com/a1mery,

I don't quite understand why I'd have to 'update my data architecture'. The only fields I'd be migrating would be: Comment txt, Author, and Created date.

I was hoping I could look at an existing list item created by the web part and programmatically create additional (similar) list items for the migrated comments.

Sanjeev

— Reply to this email directly, view it on GitHubhttps://github.com/pnp/sp-dev-fx-webparts/issues/5352#issuecomment-2506278493, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACON3QLHMIZY4O7VCQV7IZL2C4TUZAVCNFSM6AAAAABSKDJJ36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBWGI3TQNBZGM. You are receiving this because you were mentioned.Message ID: @.***>