Approaches to migrate the Likes from an on-premise discussion board list to sharepoint online

Steel Contributor

I have an on-premises sharepoint 2013 team site, which contain a discussion board list, that has rating enabled. now i used a third party tool named sharegate to do the migration. where everything were migrated correctly, except the Like for the discussion board list. now i contacted the third part company and they mentioned that currently the tool does not support this.

so my question is if i can migrate the likes by writing a power-shell script, to read the likes from the on-premises lists' items and update the migrated discussion board list?

Thanks

5 Replies

Hey @john john,

 

First, are you sure you want to keep using the discussion board as a social tool? It is pretty outdated and Microsoft has made some good effort in better social tools such as Microsoft Teams for collaboration, maybe even Yammer still.

 

If you plan to keep using it, maybe we can work out a way for you to migrate your likes to Sharepoint Online. We'll need to solve some questions like, are you using the same AD?

 

Regards


@Deleted wrote:

Hey @john john,

 

First, are you sure you want to keep using the discussion board as a social tool? It is pretty outdated and Microsoft has made some good effort in better social tools such as Microsoft Teams for collaboration, maybe even Yammer still.

 

If you plan to keep using it, maybe we can work out a way for you to migrate your likes to Sharepoint Online. We'll need to solve some questions like, are you using the same AD?

 

Regards

 


@Deleted 

yes we are planning to keep using the Discussion board list. as it is already been used for around 5 years now and it is a formal mean to add news and announcements, and  a formal mean to confirm that a user read the announcement by clicking on the Like link.

now i tried to use the modern pages with commenting, but i faced a major drawback is that anyone can delete others' comments, and the comments are not going to be sent tot the recycle bin. so we can have a long discussion and  a user can intentionally or by mistake delete all the comments and we will not be able to restore them or even know who did the deletion... maybe in the future if Microsoft fix this major problem we will consider using modern pages with commenting to replace the discussion board list. but i think i will face another issue is that i do not think our migration tool will support converting the discussion board items into modern pages..

Final note. in this forum i always get replies from suers mentioning that this appraoch is outdated and there is a newer appraoch,, now when you work in Enterprise environment (as the one i am currently working on) adopting changes will be slower, and many factors affect changing our formal announcement list... also when i discuss the issue of deleting comments on modern pages without the ability to restore them, i got a clear word from the management, that we can not adopt this modern way of commenting. also as a policy inside our company, that anything deleted inside sharepoint, should be sent to the recycle bin and the admin should be able to restore it. also  we should know who delete anything inside sharepoint,, and those are not currently achievable inside the commenting feature for modern pages... not talking about that backuping the site collection will not preserve the commenting on modern pages, as they are stored outside the farm,,,

Hey @john john ,

 

Yeah I know what you mean when you say it is hard to change the way things work when it comes to big companies. I still think it could be worth having a word with the managers about the benefits of migrating to a new platform. I wouldn't recommend the comments section either. As you mentioned, there's still a lot of work to be put in there.

Anyway, if you want to stick to Discussion Board and have your likes migrated, there may be a way out, although I don't think it would be trivial. First, are using the same AD that you use in your on-prem Sharepoint? If so, can you also check if a user has the same ID both in Sharepoint on-prem and Sharepoint Online?

If the user has the same ID  in both versions, then your task would be much easier, although I don't think that would happen. Lemme know if you need any help.

 

Regards,


@Deleted wrote:

Hey @john john ,

 

Yeah I know what you mean when you say it is hard to change the way things work when it comes to big companies. I still think it could be worth having a word with the managers about the benefits of migrating to a new platform. I wouldn't recommend the comments section either. As you mentioned, there's still a lot of work to be put in there.

Anyway, if you want to stick to Discussion Board and have your likes migrated, there may be a way out, although I don't think it would be trivial. First, are using the same AD that you use in your on-prem Sharepoint? If so, can you also check if a user has the same ID both in Sharepoint on-prem and Sharepoint Online?

If the user has the same ID  in both versions, then your task would be much easier, although I don't think that would happen. Lemme know if you need any help.

 

Regards,


yes both the on-premises and online have the same AD...

Ok, so I will post a possible solution here, lemme know if it helps.

A made a REST call the a discussion board I created (https://tenant.sharepoint.com/_api/web/lists/getbytitle('Discussion Board')/items?) and if you put the result in a XML formatter you will be able to see that the items in the discussion board have two specific properties, LikesCount and LikedByStringId. So I believe that, in order to replicate the Likes, you would a solution that gets all items, pick these values, and save them to the items in your new list at Sharepoint Online. Mind you that, meanwhile your users are from the same AD, they may not have the same ID at Sharepoint. So the Id's referenced in the LikedByStringId field will need to be "translated" to the respective Id's of the same users at Sharepoint Online. My step-to-step to the code would be something like:

 

  1. Gets all the users at old tenant, saving them in a Data structure. Let's call it Users1[].
  2. Gets all items at the old Discussion board list, saving it in a Data sctructure too. Let's call it DB1[].
  3. Gets all the users at new tenant, saving them in a Data structure. Let's call it Users2[].
  4. Gets all items at the new Discussion board list, saving it in a Data sctructure too. Let's call it DB2[].
  5. Loop through DB1[] and for every item gets the respective item in DB2[], assuming the lists have the same items. Then you copy the value of LikesCount and LikedByStringId from DB1 to DB2. However, you have to "resolve" the Id's in the LikedByStringId to Ids corresponding to your new tenant, using Users1 and Users2. You can maybe use the LoginName of the user for that.
  6. After resolving the new Ids, store them at DB2[] and save the items in DB2[] to your new tenant again. That should update Likes at your new list.

 

Well I know that may sound cumbersome, so if you have any questions let me know.

 

Regards,

  1.