douglascayers / sfdc-convert-attachments-to-chatter-files

đź“Ž Easily migrate your Attachments to Salesforce Files.
https://douglascayers.com/2015/10/10/salesforce-convert-attachments-to-chatter-files/
BSD 3-Clause "New" or "Revised" License
73 stars 29 forks source link

Conversions not running in sandbox #20

Closed dvanzeg closed 7 years ago

dvanzeg commented 7 years ago

I've downloaded the conversion tool to my sandbox and have followed the both the per-requisite and Getting Started steps. I added some test attachments to a contact record and have tried running the conversion tool three ways:

douglascayers commented 7 years ago

Hi @dvanzeg,

Could you provide screen shots or a link to quick video showing your steps?

What edition of Salesforce is your sandbox? Professional, Group, Enterprise, etc.

Did you install the managed package version of the app or deployed source from github?

To look for errors that might be exposed in other areas, try capturing the Debug Logs generated when you run the conversion, as well as make sure you're subscribed to receive Apex Exception Emails and that Email Deliverability is set to All Emails.

Thanks

dvanzeg commented 7 years ago

Hi Doug,

Thank you for your prompt reply. I downloaded the managed package for sandboxes and I am running the Enterprise edition.

I followed your steps as outlined here: https://github.com/DouglasCAyers/sfdc-convert-attachments-to-chatter-files *

*In my first attempt, I had missed the step to assign myself the Convert Attachments to Files permission set. I had tried running a test conversion and received an error message in the log that prompted me to relook at the Getting Started steps and assign the set.

In the sandbox, I added 3 attachments to the old Notes & Attachments object (see below):

I set up my conversion settings:

As I mentioned in my post, I ran the conversion test three times

· using the contact record’s ID as the attachment parent record id;

· using the Notes & Attachment object’s ID attachment parent record id;

· using no attachment parent record id

BTW….which is the proper ID to use?

When I check the “Convert Attachment to Files Logs”, the only error logged is the very first one when I had failed to assign myself the permission set. I follow your recommendations for trying to capture the Debug Logs and well subscribing for the Apex Exception Emails and setting the Email Deliverability to all emails.

Just an fyi…you may have already figured it out but I’m not a developer. I’m the sys admin for a small nonprofit, definitely of the button-click admin variety. The nonprofit HUB has pretty much been dead quiet as far as how to successfully migrate so I sincerely appreciate your help in trying to figure this out.

Deb

Deb Van Zegeren

Administrative and Communications Manager

Cutaneous Lymphoma Foundation

PO Box 374

Birmingham, MI 48012-0374

Office 1: 248.644.9014, Extension 1

Fax: 248.233.3770

Email: debra@clfoundation.org debra@clfoundation.org

Web: www.clfoundation.org

From: Doug Ayers [mailto:notifications@github.com] Sent: Saturday, April 08, 2017 6:18 PM To: DouglasCAyers/sfdc-convert-attachments-to-chatter-files Cc: dvanzeg; Mention Subject: Re: [DouglasCAyers/sfdc-convert-attachments-to-chatter-files] Conversions not running in sandbox (#20)

Hi @dvanzeg https://github.com/dvanzeg,

Could you provide screen shots or a link to quick video showing your steps?

What edition of Salesforce is your sandbox? Professional, Group, Enterprise, etc.

Did you install the managed package version of the app or deployed source from github?

To look for errors that might be exposed in other areas, try capturing the Debug Logs generated when you run the conversion, as well as make sure you're subscribed to receive Apex Exception Emails https://help.salesforce.com/articleView?id=code_apex_exceptions.htm and that Email Deliverability https://help.salesforce.com/articleView?id=emailadmin_deliverability.htm is set to All Emails.

Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DouglasCAyers/sfdc-convert-attachments-to-chatter-files/issues/20#issuecomment-292749496, or mute the thread https://github.com/notifications/unsubscribe-auth/AZwvIf8qN1_12fe7sjwSZbzQkQx0pgofks5ruAeFgaJpZM4M25gS .

douglascayers commented 7 years ago

Thanks for the follow up @dvanzeg. And you're doing great my #AwesomeAdmin friend =)

When testing the conversion, you would enter the ID of the record you uploaded the attachments to. So if you uploaded the attachments to a Contact then you'd paste the Contact's 15 or 18 character ID in the text field.

When you click the Submit button on the conversion page, do you get a green message that says "Conversion batch job submitted: 707xxxxxxxxxxxxxxx"?

image

If no then the conversion job is not being submitted and we need to figure out why.

If yes then in Setup please navigate to Setup | Jobs | Apex Jobs and check to see if the job ran and if there were any errors reported.

image

dvanzeg commented 7 years ago

Douglas,

Now I’m even more stumped…the apex jobs appear to have been completed but the attachment files remain in the original Notes & Attachments rather than in Files. I’m going to review the set-up steps to make sure I haven’t missed something.

Deb

From: Doug Ayers [mailto:notifications@github.com] Sent: Tuesday, April 11, 2017 12:41 AM To: DouglasCAyers/sfdc-convert-attachments-to-chatter-files Cc: dvanzeg; Mention Subject: Re: [DouglasCAyers/sfdc-convert-attachments-to-chatter-files] Conversions not running in sandbox (#20)

Thanks for the follow up @dvanzeg https://github.com/dvanzeg. And you're doing great my #AwesomeAdmin friend =)

When testing the conversion, you would enter the ID of the record you uploaded the attachments to. So if you uploaded the attachments to a Contact then you'd paste the Contact's 15 or 18 character ID in the text field.

When you click the Submit button on the conversion page, do you get a green message that says "Conversion batch job submitted: 707xxxxxxxxxxxxxxx"?

[image: image] https://cloud.githubusercontent.com/assets/4142577/24893064/a35077d8-1e46-11e7-8bff-3272a5561bd5.png

If no then the conversion job is not being submitted and we need to figure out why.

If yes then in Setup please navigate to Setup | Jobs | Apex Jobs and check to see if the job ran and if there were any errors reported.

[image: image] https://cloud.githubusercontent.com/assets/4142577/24893099/f24aecec-1e46-11e7-919c-1d35e7fc0a8e.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DouglasCAyers/sfdc-convert-attachments-to-chatter-files/issues/20#issuecomment-293147977, or mute the thread https://github.com/notifications/unsubscribe-auth/AZwvIUxmJmqnHHhn8k2g8xvMoFN9zSvWks5ruwQ_gaJpZM4M25gS .

dvanzeg commented 7 years ago

Update: Success!!

I went back through the directions with a fine tooth comb and found a couple of missteps on my part:

· I hadn’t installed the latest release;

· I had skipped over step 2 (Enable setting Files uploaded to the Attachments related list on records are uploaded as Salesforce Files, not as attachments) thinking I had already performed it.

Once I took those steps and ran the tool, I did receive the Visibility error message and followed your instructions to set my Conversion Settings to “all users”

Voila! The attachments migrated!!! The only step that didn’t occur is I had set for the original files to be deleted and they weren’t. That’s not a huge issue for me because on my production instance I’m only at 3% for File Storage so duplications won’t break the bank. But I wanted to let you know in case it’s an issue for larger orgs.

Thank you for sharing your very helpful app and for providing me with guidance in setting it up for use!! This just made my week!!!

Deb

From: Doug Ayers [mailto:notifications@github.com] Sent: Tuesday, April 11, 2017 12:41 AM To: DouglasCAyers/sfdc-convert-attachments-to-chatter-files Cc: dvanzeg; Mention Subject: Re: [DouglasCAyers/sfdc-convert-attachments-to-chatter-files] Conversions not running in sandbox (#20)

Thanks for the follow up @dvanzeg https://github.com/dvanzeg. And you're doing great my #AwesomeAdmin friend =)

When testing the conversion, you would enter the ID of the record you uploaded the attachments to. So if you uploaded the attachments to a Contact then you'd paste the Contact's 15 or 18 character ID in the text field.

When you click the Submit button on the conversion page, do you get a green message that says "Conversion batch job submitted: 707xxxxxxxxxxxxxxx"?

[image: image] https://cloud.githubusercontent.com/assets/4142577/24893064/a35077d8-1e46-11e7-8bff-3272a5561bd5.png

If no then the conversion job is not being submitted and we need to figure out why.

If yes then in Setup please navigate to Setup | Jobs | Apex Jobs and check to see if the job ran and if there were any errors reported.

[image: image] https://cloud.githubusercontent.com/assets/4142577/24893099/f24aecec-1e46-11e7-919c-1d35e7fc0a8e.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DouglasCAyers/sfdc-convert-attachments-to-chatter-files/issues/20#issuecomment-293147977, or mute the thread https://github.com/notifications/unsubscribe-auth/AZwvIUxmJmqnHHhn8k2g8xvMoFN9zSvWks5ruwQ_gaJpZM4M25gS .

douglascayers commented 7 years ago

Ya! Thanks for the follow up and details @dvanzeg, glad you got it working =)

dvanzeg commented 7 years ago

Hi Doug,

Thank you, thank you! With your app I was able to migrate over 6000 attachments today! I’ve got a few that are being stubborn, but oddly if I load them individually into the Test Conversion, they will migrate. It’s only a few so I’m not going to sweat it.

With your permission, I’d like to share a copy of your directions with a link to the app on the Power of Us HUB and to a private user group where we’ve been discussing how to migrate documents – with all credit given to you. I added just a few notes, most to help point folks to exactly where in Set-up to find the settings they will need. I know for myself, that sometimes half the battle is knowing where to go.

Again much gratitude for sharing your app and so graciously giving me advice on how to make it work successfully!

Best regards,

Deb

From: Doug Ayers [mailto:notifications@github.com] Sent: Tuesday, April 11, 2017 7:16 PM To: DouglasCAyers/sfdc-convert-attachments-to-chatter-files Cc: dvanzeg; Mention Subject: Re: [DouglasCAyers/sfdc-convert-attachments-to-chatter-files] Conversions not running in sandbox (#20)

Ya! Thanks for the follow up and details @dvanzeg https://github.com/dvanzeg, glad you got it working =)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DouglasCAyers/sfdc-convert-attachments-to-chatter-files/issues/20#issuecomment-293427393, or mute the thread https://github.com/notifications/unsubscribe-auth/AZwvIbOXich8Q3tgigWNFwWmrLMoLEWhks5rvAnMgaJpZM4M25gS .

douglascayers commented 7 years ago

Hi Deb,

That's terriffic, thanks for sharing the good news! And yes, I'd be thrilled if you share links to this project to other groups so they can benefit from this tool.

I would love to know if you the attachments that weren't converting you got any error messages? Perhaps try converting those last few with smaller batch size might help?

Would you mind sharing your instructions that are more helpful to you so that I can take that into consideration in updating my own README and instructions document?

Thanks,

Doug

dvanzeg commented 7 years ago

Doug,

I’ve attached the pdf of your directions with my added notes in red. Thank you for allowing me to share them!

In answer to your question, there were about 250 that didn’t migrate but I only received the following error messages:

I’m going to run another export of the remaining files tomorrow and try running them through again.

Deb

From: Doug Ayers [mailto:notifications@github.com] Sent: Wednesday, April 12, 2017 3:21 PM To: DouglasCAyers/sfdc-convert-attachments-to-chatter-files Cc: dvanzeg; Mention Subject: Re: [DouglasCAyers/sfdc-convert-attachments-to-chatter-files] Conversions not running in sandbox (#20)

Hi Deb,

That's terriffic, thanks for sharing the good news! And yes, I'd be thrilled if you share links to this project to other groups so they can benefit from this tool.

I would love to know if you the attachments that weren't converting you got any error messages? Perhaps try converting those last few with smaller batch size might help?

Would you mind sharing your instructions that are more helpful to you so that I can take that into consideration in updating my own README and instructions document?

Thanks,

Doug

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DouglasCAyers/sfdc-convert-attachments-to-chatter-files/issues/20#issuecomment-293680582, or mute the thread https://github.com/notifications/unsubscribe-auth/AZwvIRcIK_m1oSwrFH3M8flPu0IGAyr6ks5rvSQFgaJpZM4M25gS .

douglascayers commented 7 years ago

Well, the attachments and image didn't come through with the email reply to comment. I think files have to be added directly from the github website when adding the comment there. Would you mind posting them as a new comment here: https://github.com/DouglasCAyers/sfdc-convert-attachments-to-chatter-files/issues/20

Thanks!

dvanzeg commented 7 years ago

Happy to!

Convert Attachments to Salesforce Files_DougCAyers.pdf

image

image

douglascayers commented 7 years ago

Thanks Deb!

Regarding error INSUFFICIENT_ACCESS_OR_READONLY, Invalid sharing type: I means the app is being blocked from sharing the new file to the attachment's parent record AND granting users inferred read/write access to the file. I've heard reports from others where they sometimes get this when they try to convert attachments belonging to standard objects. In your testing, if you can narrow down to which objects are giving you grief with this error and let me know what organization-wide sharing settings might be being used with them that would be helpful, as well as any extra info about the License Types of the attachment owners. I've not been able to reproduce this myself so still hunting for what scenario causes the problem so I can either adjust code for it or at least have a FAQ about it.

Regarding error UNABLE_TO_LOCK_ROW the app when inserting the new files was not able to get exclusive access to Content Folder with ID 07H50000000KzlpEAK. My code doesn't reference Content Folder object directly so I'm guessing this may be something behind the scenes Salesforce does either (a) for any file being created or (b) if files are owned by community/portal users maybe?? I'll have to do some more digging on that one. Does your org have any triggers on ContentDocument, ContentVersion, ContentDocumentLink, or Attachment objects?

Thanks!

Doug

dvanzeg commented 7 years ago

Here is what I found:

Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_OR_READONLY, Invalid sharing type I: [ShareType]

Issue with: • Solutions - see settings below...don't know if these are helpful to you or not but thot I'd include them:

image

Users: License type: Enterprise Owner rights: Sys Admin Sharing: Full permissions (RCEDVM)

• Email Template – Attachment file to template

I was able to "massage" everything else through and whittle my remaining attachments down to 28. Since I started with over 6000, this makes me very happy!! :)

The attachments to email templates doesn't really surprise me, it's a bit out of the "object" norm. As far as the Unable to lock row errors, I'm wondering if I received those because I was copying/pasting parent ids from an export list and parent ids were duplicated where an object had more than one attachment. Perhaps it was trying to fire at the same time? In answer to your question, I don't have any triggers on content/attachment objects.

Thank you again for all your help. If I ever run into you at a SF event, I owe you beverage/s of your choice big time!!

douglascayers commented 7 years ago

Thanks Deb, this is great info! Really appreciate you taking the extra time to research this to help improve this project!

On Apr 13, 2017, at 1:26 PM, dvanzeg notifications@github.com wrote:

Here is what I found:

Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_OR_READONLY, Invalid sharing type I: [ShareType]

Issue with: • Solutions - see settings below...don't know if these are helpful to you or not but thot I'd include them:

• Email Template – Attachment file to template

Users: License type: Enterprise Owner rights: Sys Admin Sharing: Full permissions (RCEDVM)

I was able to "massage" everything else through and whittle my remaining attachments down to 28. Since I started with over 6000, this makes me very happy!! :)

The attachments to email templates doesn't really surprise me, it's a bit out of the "object" norm. As far as the Unable to lock row errors, I'm wondering if I received those because I was copying/pasting parent ids from an export list and parent ids were duplicated where an object had more than one attachment. Perhaps it was trying to fire at the same time? In answer to your question, I don't have any triggers on content/attachment objects.

Thank you again for all your help. If I ever run into you at a SF event, I owe you a cold beverage of your choice!!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

douglascayers commented 7 years ago

Hi Deb,

For Solution and EmailTemplate objects, I was able to convert the attachments to files if I chose the "Users can only view the file but cannot edit it" conversion setting. Not a clue why that's a limitation...

Regarding EmailTemplate, even if the attachment is converted you don't see the related Files and the related Files are not sent along with the email template - only the attachments.

I imagine there are more objects with nuances and quirks like this, unfortunately requires people to test all the scenarios to uncover them.

Thanks,

Doug

dvanzeg commented 7 years ago

Hi Doug,

Thank you for the updated information. It sounds like I should leave the email template attachments alone and only migrate the other files.

Have you run across any information, or perhaps know firsthand, how to deal with files located in the Document object? Should they be migrated to Files? Is there any way to create folders within Files like there was in Documents object? As I look at the Files object in Lightning, I’m not seeing any way to organize what’s there other than filtering by what’s owned by me, shared with me, recent or following. Losing my method of organizing current documents is going to make finding them when necessary.

Thank you again for your help. I’ve posted links to your app in the HUB as well as in a private user group. Ashima Saigal and I are going to present at Midwest Dreaming on preparing for switching to Lightning and I’ll definitely be promoting your app in our presentation.

Deb

From: Doug Ayers [mailto:notifications@github.com] Sent: Friday, April 21, 2017 7:20 PM To: DouglasCAyers/sfdc-convert-attachments-to-chatter-files Cc: dvanzeg; Mention Subject: Re: [DouglasCAyers/sfdc-convert-attachments-to-chatter-files] Conversions not running in sandbox (#20)

Hi Deb,

For Solution and EmailTemplate objects, I was able to convert the attachments to files if I chose the "Users can only view the file but cannot edit it" conversion setting. Not a clue why that's a limitation...

Regarding EmailTemplate, even if the attachment is converted you don't see the related Files and the related Files are not sent along with the email template - only the attachments.

I imagine there are more objects with nuances and quirks like this, unfortunately requires people to test all the scenarios to uncover them.

Thanks,

Doug

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DouglasCAyers/sfdc-convert-attachments-to-chatter-files/issues/20#issuecomment-296326566, or mute the thread https://github.com/notifications/unsubscribe-auth/AZwvIRuaEqXNHUpa5yO7q0zZM3d17y7bks5ryTmXgaJpZM4M25gS .

douglascayers commented 7 years ago

Hi Deb,

I'm honored that you'd be sharing about this project at Midwest Dreamin. I will be there so definitely hope to meetup and thank you for your contributions in person!

Salesforce is bringing the concept of Folders to Files. I believe it's beta in Spring 17 release and should (safe harbor) be generally available in Summer 17

https://releasenotes.docs.salesforce.com/en-us/spring17/release-notes/rn_files_folders.htm

https://releasenotes.docs.salesforce.com/en-us/summer17/release-notes/rn_files_libraries_folders_updates.htm

It's on my todo list to support converting documents in folders to files in library folders.

Doug

On Apr 24, 2017, at 5:52 AM, dvanzeg notifications@github.com wrote:

Hi Doug,

Thank you for the updated information. It sounds like I should leave the email template attachments alone and only migrate the other files.

Have you run across any information, or perhaps know firsthand, how to deal with files located in the Document object? Should they be migrated to Files? Is there any way to create folders within Files like there was in Documents object? As I look at the Files object in Lightning, I’m not seeing any way to organize what’s there other than filtering by what’s owned by me, shared with me, recent or following. Losing my method of organizing current documents is going to make finding them when necessary.

Thank you again for your help. I’ve posted links to your app in the HUB as well as in a private user group. Ashima Saigal and I are going to present at Midwest Dreaming on preparing for switching to Lightning and I’ll definitely be promoting your app in our presentation.

Deb

From: Doug Ayers [mailto:notifications@github.com] Sent: Friday, April 21, 2017 7:20 PM To: DouglasCAyers/sfdc-convert-attachments-to-chatter-files Cc: dvanzeg; Mention Subject: Re: [DouglasCAyers/sfdc-convert-attachments-to-chatter-files] Conversions not running in sandbox (#20)

Hi Deb,

For Solution and EmailTemplate objects, I was able to convert the attachments to files if I chose the "Users can only view the file but cannot edit it" conversion setting. Not a clue why that's a limitation...

Regarding EmailTemplate, even if the attachment is converted you don't see the related Files and the related Files are not sent along with the email template - only the attachments.

I imagine there are more objects with nuances and quirks like this, unfortunately requires people to test all the scenarios to uncover them.

Thanks,

Doug

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DouglasCAyers/sfdc-convert-attachments-to-chatter-files/issues/20#issuecomment-296326566, or mute the thread https://github.com/notifications/unsubscribe-auth/AZwvIRuaEqXNHUpa5yO7q0zZM3d17y7bks5ryTmXgaJpZM4M25gS . — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.