I would either built a small console app using CSOM or use PowerShell and CSOM together.
I haven't checked if this code works, but it probably look something like this:
using (var context = TokenHelper.GetClientContextWithAccessToken(uri.ToString(), token))
{
var web = context.Web;
using (var fs = new FileStream(sourceFilePath, FileMode.Open))
{
FileInfo fi = new FileInfo(sourceFilePath);
FileCreationInformation flciNewFile = new FileCreationInformation();
flciNewFile.ContentStream = fs;
flciNewFile.Url = System.IO.Path.GetFileName(sourceFilePath);
flciNewFile.Overwrite = overWriteIfExists;
List docs = web.Lists.GetByTitle(listName);
Microsoft.SharePoint.Client.File uploadFile = docs.RootFolder.Files.Add(flciNewFile);
context.Load(uploadFile);
context.ExecuteQuery();
fs.Close();
//publish the file
uploadFile.Publish("comment");
context.ExecuteQuery();
}
}
}
Create major versions
setting is required. The document's would automatically have versions as1.0
,2.0
and so on. This means the files would be in a published state once they are copied to the destination.