Upload Multiple Files to the Documents Module

I have a client who is migrating to Sugar from another system. They have a number of files in their current system that they want to make accessible in Sugar. The current files are all stored in one folder withe Record ID and a sequential number prep-pended to the files name (e.g. 87654321-1-Company Information.docx)

Has anyone come across any tools that help with Document migration?

Parents
  • Hello John,

    I am sure the original project you needed this for is long gone but I have something that I believe will work and may work for this fairly common use case.

    Using a combination of Postman and the Postman command line tool Newman (Running collections on the command line with Newman | Postman Learning Center) you should be able to upload files in a certain path from a csv.

    This post helped me get pointed in the right direction: Run collections with file uploads using Newman | Postman Blog

    I would be happy to provide some more details but what I did was create a collection with 2 Requests. The first creates the Note (or Document) record. The second Attaches the file. Then I exported the collection and modified the collection json changing the "src" path on the proper request in an editor.

    I added some Postman test steps to automatically get a new token if the current one expires and rerun the current request.

    The csv file should have the file name and any information for the linked record. A command similar to below will run the file against the collection and using environment variables.

    newman run DocumentImporter.postman_collection.json -e localhost.postman_environment.json -d documents.csv

    This is definitely a shorthand version of what is involved but it is a path in the right direction. If anyone is interested I'd be happy to provide some additional details.

Reply
  • Hello John,

    I am sure the original project you needed this for is long gone but I have something that I believe will work and may work for this fairly common use case.

    Using a combination of Postman and the Postman command line tool Newman (Running collections on the command line with Newman | Postman Learning Center) you should be able to upload files in a certain path from a csv.

    This post helped me get pointed in the right direction: Run collections with file uploads using Newman | Postman Blog

    I would be happy to provide some more details but what I did was create a collection with 2 Requests. The first creates the Note (or Document) record. The second Attaches the file. Then I exported the collection and modified the collection json changing the "src" path on the proper request in an editor.

    I added some Postman test steps to automatically get a new token if the current one expires and rerun the current request.

    The csv file should have the file name and any information for the linked record. A command similar to below will run the file against the collection and using environment variables.

    newman run DocumentImporter.postman_collection.json -e localhost.postman_environment.json -d documents.csv

    This is definitely a shorthand version of what is involved but it is a path in the right direction. If anyone is interested I'd be happy to provide some additional details.

Children
No Data