Backing up Frisbii information outside Salesforce

Prev Next

Mary Evans, Cloud Kicks' accountant, is'naturally far-sighted. Even though all billing data is stored in Salesforce, a highly secure cloud authorized to store sensitive information such as health data (see Salesforce security, privacy and architecture, PDF document), she would like to have'a second backup.
She wants to be sure of complying with the law, which stipulates that accounting documents and supporting evidence must be kept for ten years (French Commercial Code - Article L123-22).
'She therefore contacts Linda, her Salesforce/Frisbii administrator, to find out about the various possibilities for'data export, particularly for invoice PDFs.

Preamble

Frisbii is entirely based on the Salesforce platform. Here, we present functions that are mainly linked to Salesforce. If you want to set up automatic archiving of your data, there are many companies offering this, notably on'AppExchange, Salesforce's applications marketplace: List of applications dedicated to automatic data archiving.

Export PDFs stored in Documents vs Files

Generally speaking, the number of PDFs exported simultaneously from the list view is affected by the size of the PDFs. If your PDFs are several pages long or contain heavy images, the number of PDFs exported at the same time is reduced.

For PDF export, we use two different engines depending on where your PDFs are stored:

  • Documents: 10 to 15 PDFs.
  • Files: 200 PDFs.


If you'd like to save your PDFs in Files, here's how.

Save in Files: Activate export from a list view

To activate bulk export, and if you store your PDFs in Files instead of Documents, please follow these steps.

Steps

1. Go to Frisbii Administration tab.
2. From this page, go to Files management tab.
3. Check the box Activate PDF export from Files.


4. Click on Confirm.

   

The manual export of PDF invoices in list view via a Frisbii button

In the list view of the Invoice object, Frisbii provides a button for exporting PDFs of multiple invoices with a single click. The list view selection is limited to 200 records (Salesforce limit), so you can't export more than 200 invoices at a time.

If you wish to export more than 200 invoices, you can do so in several batches, taking care not to re-export the same invoices, for example by exporting periods one after the other (first week, second week...), by filtering the list view.

Steps

  1. Go to Invoice tab.
  2. Choose a list view other than Recently viewed.
  3. Select invoices.
  4. Click on the Export PDF button.


  1. A page appears with information on the selected invoices, including whether a PDF has already been generated. The missing PDF is symbolized by a white cross in a red disc. If any PDFs have not been generated, click on the Generate missing PDFs button before the export step.


  1. At this stage, all your invoices should have a PDF generated (symbolized by a white tick in a green disc). Click on the Generate zip file for export button.

​​​​​​​

 

  1. A success message appears at the top of the page with a green background. Click on the link to the ZIP file at the end of this message.

 ​​​​​​​    

   

  1. A file save page appears. You can either Share this file or, as we're interested in here, click on Download in the top right-hand corner to download the file to your computer.

   ​​​​​​​


  1. The file has been automatically downloaded to your computer, probably in your Download folder.


  1. You now have a ZIP file with all selected invoices in PDF format. You can use a secure storage service to keep a copy of these files.

​​​​​​​

Add PDF export button

If the button doesn't appear in your list views, you'll need to add it to the List View Button Layout, here's how to do it.

Steps

1. Go to Setup.
2. Then, in the Object Manager and in the object Invoice.
3. Click on List View Button Layout.
4. Then click on the small arrow to the right of the List view line.
5. Click on Edit.

 
6. Choose Export PDF from the Available buttons list.
7. Click on Add.
 


8. Save.

Note: If the button is not available in this list, we will need to update your application. Open a request on our support community to inform us of this request.

 

Automatic data export

Salesforce provides users with an automatic data export feature, which can be scheduled on a recurring basis or triggered manually.
Here is Salesforce's explanation, which you can find in this article:

"You can manually generate backup files once every 7 days (for weekly export) or every 29 days (for monthly export). In Professional Edition and Developer Edition, you can generate backup files only every 29 days. You can schedule automatic generation of backup files at weekly or monthly intervals (only monthly intervals are available in Professional Edition and Developer Edition).

Heavy traffic can delay delivery of an export. For example, let's say you plan to run a weekly export from April 1 until at the end of the month. The first export request is queued up at, but due to heavy traffic, it'is not delivered until April 8. On April 7, when your second'export request is scheduled, the first request is still in the'queue. As a result, the second request will not be processed until April 14."

Steps for requesting export

  1. Go to your Setup.

  2. In the quick search, search for Export.

  3. Choose Data > Data Export.

  4. Click on the Export now button to submit a export request within 48 hours. Click on the other button if you wish to export on a regular basis.

​​​​​​​


  1. A page appears for selecting what is to be exported. Check at the top "Include images, documents and attachments" and in the list "ContentVersion". And, if you have clicked on "Schedule export" choose the desired frequency, start, end and time of export. Salesforce also recommends exporting the file in Unicode (UTF-8).
         

       

Steps for recovering files

  1. It may take more than 24 hours to prepare the download link. You will receive an e-mail with the subject line "The export of your company data is now complete followed by the name of your organization. A link is available in this email to take you back to Data > Export data.

   ​​​​​​​


  1. Click on Download to the left of the ZIP file name generated automatically.
  1. The ZIP file is downloaded to your computer. Inside the zip are two folders: "ContentVersion" which contains all files stored in Files (lightning storage) and "Documents" which contains all files stored in Document (classic storage). The zip also contains csv files which list information about the exported files.

​​​​​​​

  1. The files in the two folders are identified by their ID, do not have a file extension and are therefore not readable in their current state.

​​​​​​​  

  1. On a PC, you can unzip the complete folder and then rename the files to add the extension ".pdf" behind the desired files. To speed up renaming, follow the procedure below.

​​​

   

Steps for renaming files

This procedure is described by Salesforce at this address.  

Prerequisite: unzip the Salesforce import ZIP file.

Variant for files from File :

  1. Open the file "ContentVersion.csv" in a spreadsheet program (Excel is recommended to use the same formula). It is advisable to keep a copy, especially if you use software such as Gsheet, which permanently saves your changes.



  2. Delete all columns except "ID" and "PathOnClient". You should end up with "ID" in column A and "PathOnClient" in column B.




  3. Copy this formula into cell C2: ="RENAME "&A2&" """&B2&"""".

  4. The result should look like this: RENAME 0685I000000aG5uQAE "PictoFrisbii.png".

       ​​​​​​​


  1. Copy this formula throughout column C.


  1. Select the entire C column and copy it.

  1. Open Notepad.
  1. Copy column C into the blank notepad file.

       


  1. Save the file as fix.bat in the ContentVersion folder, along with all the files to be renamed. Note: If you have a large number of files (over 512MB), they will be separated into several folders, into which you will need to copy the fix.bat file and perform the actions below several times.

​​​​​


  1. Double-click on the fix.bat file.
  1. All files have been renamed. Their ID has been replaced by their name. If some files have not been renamed, this means that they have the same name as others, continue this procedure; otherwise, congratulations, you're done.

​​​​​​​


  1. Cut files that have not been renamed (they do not have extensions).

  2. Create a new folder.

  3. Copy these files into it.

  1. Copy the fix.bat file there too.

​​​​​​​


  1. Double-click on the fix.bat file. If there are still any unrenamed files, start again at step 13.

Variant for files from Document :

  1. Open the file "Document.csv" in a spreadsheet program.
  2. Delete all columns except Id and Name. You should end up with Id in column A and Name in column B.
  3. Follow the same procedure as for files associated with ContentVersion.