+1-888-365-2779
Try Now
More in this section

Forums / Deployment / Stage to Production

Stage to Production

8 posts, 0 answered
  1. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    14 May 2012
    Link to this post
    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
  2. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    15 May 2012
    Link to this post
    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
  3. Stefani Tacheva
    Stefani Tacheva avatar
    718 posts
    Registered:
    06 Dec 2016
    17 May 2012
    Link to this post
    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
  4. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    18 May 2012
    Link to this post
    HI Stefani,

    Can your solution fix the links in Content Block.

    Regards,
    Siddesh Kapadi
  5. Jen Peleva
    Jen Peleva avatar
    568 posts
    Registered:
    10 Nov 2016
    19 May 2012
    Link to this post
    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
  6. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    21 May 2012
    Link to this post
    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
  7. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    30 May 2012
    Link to this post
    HI Team Telerik,

    Any replies on this?
  8. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    05 Jun 2012
    Link to this post
    Hi Team telerik,

    Any solution to this?
    If not please report this as a bug
8 posts, 0 answered