GET data from SharePoint on-premise and POST data to SharePoint Online - sharepoint

I need to GET data from SharePoint Server 2019 (On-premise) list and then I need to add that data to the SharePoint Online list using CSOM.
I have found the below link to get data from SharePoint Server (On-premise) list.
https://www.c-sharpcorner.com/article/sharepoint-client-object-modal-csom/
I have found below link to add data to SharePoint Online list.
https://www.c-sharpcorner.com/blogs/create-a-list-item-in-sharepoint-using-csomannouncement-list
Is that correct way or do I need prefer another way?
Thanks

If you just need list data without any version history or created/modified user and time stamps - you can export the SharePoint on-premise list to excel and use this excel file to create/import a new list in SharePoint Online.
Other options are to
Use Microsoft's "SharePoint Migration Tool" to migrate content - this is a free tool provided by Microsoft - https://learn.microsoft.com/en-us/sharepointmigration/introducing-the-sharepoint-migration-tool
use CSOM code in a VS application as per the links you have - note that you don't need to create 2 separate applications for it, just create one app and create separate instances of the ClientContext for SP on-prem and SP online
use PnP PowerShell to get all list items and then loop over each item and create each item in target SPO site OR use SharePoint Powershell module to do the same. Here is an example of a script that migrates documents but with some minor modification you can get it to work with list data - https://github.com/alimughalx/CopySharePointFilesWithMetaDataAndVersionHistory

Related

Copy a customized list form's power app from one site to another

I have a SharePoint online custom list, which I have customized its list forms ( Create & Edit ) using Microsoft Power Apps.
Now I created another list on a new SharePoint Online site, which have the same fields and settings as the original list. So is there a way to Copy-Past or Import-Export the power app form, from one list to another list on different site?
I tried to find a way to Export/Import the list but I could not find any..
Thanks
There is an open source tool called "Flow & Power Apps Migrator". It converts exported Apps, Flows and Solutions to be compatible with the target tenant or site.
It also migrates lists that are used as a datasource by the Apps and Flows.

SharePoint as presentation layer for Azure SQL and Blob

We currently have a simple requirement to present our users with a table of records. Each record has link to a PDF stored within Azure storage. We need to have our users be able to click on a record and be able to view (in line) the associated PDF.
We currently use SharePoint Online and cannot store the data within SharePoint itself (organisational policy).
Is it possible to create a SharePoint site/web part etc to do the above? We are scoping out options.
Yes, SharePoint has several ways to do that.
Your best bet may be a custom list with a custom URL column for the link to the PDFs. Then you can insert a list web part on a page.
This approach works with modern pages and with classic pages.
If you use a classic interface, you could also create an out of the box links list, but that list type does not have a web part for the modern experience, so it will only work on classic pages.
SPFx webpart can be inserted into modern page or classic page.
And you could call AD-secured APIs(custom service) in SPFx, so you could create a custom service host in Azure and consume from SPFx webpart.
Connect to Azure AD-secured APIs in SharePoint Framework solutions

Display AD contact information in SharePoint list

Is there a way to link the Active Directory to a SharePoint list and pull metadata from AD into the SharePoint list?
E.g:
Pull name, role, Location from AD and store it in the list
It usually makes more sense to pull that information into SharePoint's user profile service than to push it into a SharePoint list.
However, the answer is yes. Here are two options:
Exposing Active Directory through an External Content Type
SharePoint 2010 introduced the concept of External Content Types (and External Lists that use those content types). An External Content Type pulls its information from a data source external to SharePoint instead of storing its data in a traditional SharePoint list, but it can be displayed within SharePoint in a manner consistent with SharePoint lists and libraries.
When you add an External Content type through SharePoint 2010, you can choose between three types of data sources: WCF Service (for web services), SQL Server (for a Microsoft SQL Server database), and .NET Type (for a .NET assembly connector or a custom .NET connector). Depending on your relative comfort level with SQL Server and .NET programming, you can either set up a SQL query view that looks at Active Directory or use C# to write a .NET connector that connects to Active Directory.
For more information on writing a .NET connector, refer to Microsoft's Documentation: Differences Between Using the .NET Assembly Connector and Writing a Custom Connector.
In SharePoint 2013 you can also create an external content type from any oData source. Again, this may entail writing your own wrapper code to expose Active Directory in a way that SharePoint can consume.
Pushing Active Directory Data into a SharePoint List
An external content type resembles a SharePoint list but the data is stored externally. That means, for example, that you can't set up SharePoint alerts and workflows on the records. If you truly need to push the data from Active Directory into a SharePoint list, you'll need to explore other options.
One such option is to have a piece of code run on a scheduled basis to continually update a SharePoint list with information from Active Directory. This could take any of the following forms:
A custom SharePoint timer job written in .NET
A custom Powershell script (or console application) located on one of your SharePoint web front end servers that can be run as a Windows Scheduled Task
A site workflow with an action to query Active Directory and use the resulting information to populate a list
The challenge in every case will be programmatically updating existing records in the SharePoint list, unless you take the easy way out and just delete and re-create each record every time the process runs.

Display list items on different sharepoint portal

what do you think is the best way to display items from some Custom List (on sharepoint 2010) to completely different portal on SharePoint 2007 with minimum or not at all programming?
I tried with RSS and that is not what I need, so Am now stuck with IFRAME pointing some custom page on sp2010 that shows list items.
Under SharePoint 2007, you can try tu use the BDC feature (known as Business Connectivity Services(BCS) with SharePoint 2010).
It provides the ability to SharePoint 2007 to consume external datas like SAP. It is describe in msdn with complete tutorial:
Business Data Catalog

Copy SharePoint 2010 site collection/web application

I have a SharePoint 2010 web application with one site collection. I want to copy that site collection to a new web application on the same server.
I took a backup and restored it to a new database on the sql server. I then created a new web application with a temporary content database that I removed from the web application. I then added the restored copy of the original web app to the new web application.
The problem is the newly attached content database show 0 site collections, but there is in fact 1 single site.
I guess it has something to do with the id's? I have tried adding the content db both with and without assigning a new ID to the database.
Any idea how one can copy a site collection to a new web application on the same server?
--
Christian
Try using import/export. The main difference between import/export and backup/restore is that import/export generates new Guids.
http://technet.microsoft.com/en-us/library/ee428301.aspx
Use Windows PowerShell to export a site, list, or document library in SharePoint Server
You can use Windows PowerShell to export a site, list, or document library manually or as part of a script that can be run at scheduled intervals.
To export a site, list or document library by using Windows PowerShell
Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
On the Start menu, click All Programs.
Click Microsoft SharePoint 2010 Products.
Click SharePoint 2010 Management Shell.
At the Windows PowerShell command prompt, type the following command:

Resources