Stage to Production - On Premise – Configurations & Setup - On Premise – Configurations & Setup - Progress Community
 On Premise – Configurations & Setup

Stage to Production

  • Stage to Production
  • Hi Team Telerik,

    I am facing an unique issue of images not displaying from staging to production.

    We have created the entire site on stage server.
    The staging URL would be similar to:  http;//stageserver.com/site1/
    The production URL would be: http;//prodserver.com/

    Now by this, the images referenced inside the Content Block in stage server have the URL:
    /site1/default/image1.jpg

    After moving the database and teh code to the production URL, the image URL remain the same i.e. "/site1/default/image1.jpg". But the actual URL should be: '/default/image1.jpg"

    How do I run a script, to change the URL for production environment?

    Regards,
    Siddesh Kapadi
  • Hi Team Sitefinity,

    I am sure there would be a simple solution to my quuestion. Please if I can gget to know it as the client is getting a little impatient.

    Regards,
    Siddesh Kapadi
  • Hi,

    If the images in Image Widget have been broken and still refer to the inappropriate URL please use this Sitefiity API to recompile all image URLs. You should place the following source code in the Page_Load method of a new web form and request the web form in your browser. Please see the example bellow:

    LibrariesManager librariesManager = LibrariesManager.GetManager();
                var document = librariesManager.GetImages().Where(d => d.ApprovalWorkflowState == "Published");
       
                foreach (var doc in document)
                
                    librariesManager.RecompileItemUrls(doc);
                
       
                librariesManager.SaveChanges();
    Additional information that might be useful is that the images are saved in table sf_media_content of the database.

    Please note that you need to restart the application (make a dummy edit and save the web.config) before executing the code.

    Regards,
    Stefani Tacheva
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • HI Stefani,

    Can your solution fix the links in Content Block.

    Regards,
    Siddesh Kapadi
  • 360066_ImagesInContentBlocks.JPG
    Hello Siddesh,

    Yes, the code should fix these images as well, since when you insert an image in a  content block, the image is stored in the Image Library and the code recompiles the urls of all images in  image libraries. Please take a look at the sttached image for further reference. 

    Kind Regards,
    Jen Peleva
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Hi Team Telerik,

    The attached image is while the user is creating a new content block. But my example or request was of knowing, about the existing content Block.  I dont this it is replaced as I have already tried it.

    Please let me know the solution of the table, where the data is stored, so that we can replace the code by firing the query.

    Regards,
    Siddesh Kapadi
  • HI Team Telerik,

    Any replies on this?
  • Hi Team telerik,

    Any solution to this?
    If not please report this as a bug