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?

  • How are you performing your migration? Is this going to Sugar Cloud? Are you storing the documents in Sugar as Documents or Notes?

    If you are uploading to Sugar Cloud use the REST API to create a Document and or Note with the correct filename as you mention above and then upload the file. Sugar will handle the rest.

    If you are handling this on-premise you don't need to use the REST API to upload the file. If this the case, let me know and I can provide you will more detailed instructions.

  • Unfortunately, there is no such tool which can migrate Documents from the third party system to SugarCRM as far as I know. I have to migrate files from SAP to SugarCRM a year ago and I used a custom script to fetch data from SAP and then push it to SugarCRM using REST API.

  • Yes I did the same from Microsoft CRM to Sugar, exported the files from the MSSQL blob to filesystem, copied them over the network and ran a php script reading the file list from csv and creating Notes with the attached files.

    Harald Kuske
    Principal Solution Architect – Professional Services, EMEA
    hkuske@sugarcrm.com
    SugarCRM Deutschland GmbH

  • hi John, so based on what you said

    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)

     I believe you have a choice of various ETL tools like Talend, or a custom script.

    The following old SUgar Dev post may help:

    sugardeveloper.wordpress.com/.../

    CRM Business Consultant

  • 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.