Solved

c sharp code to read excel and move files into sharepoint

Posted on 2013-11-06
6
776 Views
Last Modified: 2013-12-01
Hi,
 I want to migrate files from file  server to a document Library in SharePoint 2013.
 On a file server say 10 thousand files are there.
 I want to 1st create 8 thousand folders, then inside each folder 1 or max 3 files to be stored.
 I am using 1 Excel sheet for this with 2 columns ,where-
1.Folder Name, 2.Path of files (from which I  migrate files ).
So I will first create a folder for a set of few files then I want files into that folder.
 Any starting code pls
0
Comment
Question by:sharepointDepot
  • 4
  • 2
6 Comments
 
LVL 53

Assisted Solution

by:Will Szymkowski
Will Szymkowski earned 125 total points
ID: 39629376
If you are simply copying files to another location you might want to just use Robocopy...

PAQ - http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2008/Q_28258952.html

Use this example below...
robocopy source destination /E /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log

Here's what the switches mean:

•source :: Source Directory (drive:\path or \\server\share\path).
•destination :: Destination Dir (drive:\path or \\server\share\path).
•/E :: copy subdirectories, including Empty ones.
•/ZB :: use restartable mode; if access denied use Backup mode.
•/DCOPY:T :: COPY Directory Timestamps.
•/COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU). Copies the Data, Attributes, Timestamps, Ownser, Permissions and Auditing info
•/R:n :: number of Retries on failed copies: default is 1 million but I set this to only retry once.
•/W:n :: Wait time between retries: default is 30 seconds but I set this to 1 second.
•/V :: produce Verbose output, showing skipped files.
•/TEE :: output to console window, as well as the log file.
•/LOG:file :: output status to LOG file (overwrite existing log).

Reference - http://community.spiceworks.com/topic/278298-move-shared-folders-and-retain-file-and-share-permissions-with-robocopy

Will.
0
 

Author Comment

by:sharepointDepot
ID: 39629892
Hi,
my target location is sharepoint library.
0
 
LVL 53

Expert Comment

by:Will Szymkowski
ID: 39630887
That should be fine. You can use the UNC path to the library and transfer the files needed.

Will.
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:sharepointDepot
ID: 39631492
Hi,
my files are on folder in document library at url-

 http://intranet.contoso.com/filezz

robocopy \\DEMO2010A\filezz \\intranet.contoso.com\Files /E /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log

unable to copy files-
1.access denied
2.path incorrect
0
 

Accepted Solution

by:
sharepointDepot earned 0 total points
ID: 39678646
0
 

Author Closing Comment

by:sharepointDepot
ID: 39687901
it helped to make folders
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Synchronize a new Active Directory domain with an existing Office 365 tenant
A brief introduction to what I consider to be the best editor for PowerShell.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question