Stage to Production

Posted by Community Admin on 05-Aug-2018 10:35

Stage to Production

All Replies

Posted by Community Admin on 14-May-2012 00:00

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

Posted by Community Admin on 15-May-2012 00:00

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

Posted by Community Admin on 17-May-2012 00:00

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

Posted by Community Admin on 18-May-2012 00:00

HI Stefani,

Can your solution fix the links in Content Block.

Regards,
Siddesh Kapadi

Posted by Community Admin on 19-May-2012 00:00

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

Posted by Community Admin on 21-May-2012 00:00

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

Posted by Community Admin on 30-May-2012 00:00

HI Team Telerik,

Any replies on this?

Posted by Community Admin on 05-Jun-2012 00:00

Hi Team telerik,

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

This thread is closed