1

We are using Sitecore 8.1 update-1 with WFFM 8.1. We are using 2 CD servers and both servers we have given the msterdatabase as below in Sitecore.Forms.config

      <setting name="WFM.MasterDatabase" value="web" />

When we try to upload the files through WFFM file upload field, the uploaded files are getting added to Web database media library.

How can we move these files to Master database, any suggestions?

  • can you check if is same scenario here : sitecore.stackexchange.com/questions/4343/… – Vlad Iobagiu Aug 8 '17 at 11:21
  • @Sitecore Climber, No its not the same scenario. For me the files are getting saved in Web database there is no error. But i want those files to be saved in master database. Is there any way to move it.? – Ramesh Aug 8 '17 at 13:16
  • what happen s if you change WFM.MasterDatabase to master value ? – Vlad Iobagiu Aug 8 '17 at 13:40
  • When i use the master database not able to submit the form. Getting error"System.NullReferenceException Message: Object reference not set to an instance of an object. Source: Sitecore.Forms.Custom at Sitecore.Form.UI.Adapters.FileUploadAdapter.AdaptResult(Object value) " . so as per this link sitecoreblog.alexshyba.com/… i have updated to web database – Ramesh Aug 8 '17 at 13:47
3

The Problem

The problem that you are facing is that the CD servers do not have access to the master database. This is intentional, as your CDs should not, in concept, need access to the master database and so it's better for security if they do not have access to it.

User Generated Content

From a user-generated content (UGC) standpoint, however, this poses some issues. If you want your authors to be able to see what users uploaded in Sitecore then this isn't feasible. Since your CM is the instance that has access to the master database, one option is to create a service on the CM that will upload your data to the master database. I do not recommend this, if you're maximizing your securities, since the CM server should never be open to the public.

Typical Recommendation: Custom Viewer

As such, I typically inform my clients up front that when users submit uploaded content it will not go to the master database, if they have a split CM and CD. If the client would like the ability to view this data from the CM, I offer to write them a custom viewer that they can access from the launchpad. I try to avoid offering to teach them to switch databases to the web database, as - more often than not - doing so tends to cause more issues down the line (client editing in the wrong DB, etc.).

Alternative: Service to Copy from web to master

Another option is to have a service that runs on your CM, that is responsible for pulling the items from the web database and recreating them in the master database.

You could create a scheduled task that crawls the section of your web database's Media Library that contains WFFM-uploaded media, downloads the media and uploads it into Sitecore. You should, of course, include support for comparing with what has already been copied to the master DB, so that you don't copy the same item twice. You can do this by ensuring that the item you copy into the master database has the same ID as the item from the web database. If you do so, you should also copy all of the field contents, as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.