Skip to content

Solution Automation CopyFilesAuto

Barbarur edited this page Sep 6, 2024 · 4 revisions

Copy files across sites

Solution Code: CopyFilesAuto

This solution has been replaced by CopyDuplicateFileAuto which includes additional features.

Description

Copy files between libraries within the same site or different sites.

Requirements

Run the solution with and account with at least SharePoint Admin role.

Parameters

Source location
Parameter Type Description
Site Url Required Site where the sourcefiles are located.
Document Library Title Required Document library where the sourcefiles are located.
Files and Items filter Optional Selects which source files will be copied. It could be all files in the document library or only some of them.
Destination location
Parameter Type Description
Site Url Required
Choice
Destination site where the sites will be copied.
Document Library Title Required Name of the library where the files will be copied.
Server relative path Optional You can specify a folder in the document library where thefiles will be copied.

How this Solution works

  1. Add account as Site Collection Admin for source site.
  2. Add account as Site Collection Admin for destination site.
  3. Checks the source site exists.
  4. Checks the destination site exists.
  5. Checks the source Library exists.
  6. Checks the destination Library exists.
  7. Checks the source library exists.
  8. Checks the destination Library exists.
  9. Checks the destination folder exists.
  10. Gets all the files from the source location.
  11. Iterates through all the files and perform:
    • Checks the file doesn't exists in target location.
    • Recreates the folder structure if missed.
    • Copy the file to the target location.
  12. Removes account as Site Collection Admin for source site.

Limitations

This solution only covers simple copy of the files at the moment. Only metadata that exists in the source and destiantion library will be copied.

In the future, it is planned this solution can also move files, including version history, manage metadata and content types.


RecycleBinReport 0.8.1

Clone this wiki locally