Media Folder - sync from production version back to development issue

Topics: General
Jun 13, 2014 at 3:47 AM
Edited Jun 13, 2014 at 5:22 AM
OK we have an issue with developing sites that are already in production.

Currently we keep our code on BitBucket and if we want to change an existing site, pull down from BitBucket and backup the live database and restore locally to the development machine.

Now this seems to work OK, except while the site is in production, users are adding media items which don't exist on the development instance. When we copy the media folder from prod to dev the media items still don't appear... how can this be resolved..

So two questions -

1) how can we solve this issue with broken media items.
2) Is this the best practice for managing sites that are in production.
Jun 13, 2014 at 3:19 PM
I do the same, except I sync media items as well - its the only way to have a true representative environment.

Jun 14, 2014 at 1:17 PM
Could you describe how you sync the media items?

Thanks mate.
Jun 14, 2014 at 2:00 PM

Media Items have 2 representations, logical and physical. Logical is the content item in the database, this holds the pointer to the Physical. The Physical is the file on the file system.

So when I take the database back I also take the Media folder for that tenant.

Jun 14, 2014 at 2:10 PM
But we are copying the media folder as well as a backup of the database and media items are not visible..?
Jun 14, 2014 at 2:18 PM
Are you updating the Base URL of your site?

Jun 14, 2014 at 3:05 PM
Good point, will check this .. Very obvious but also very easy to forget!
Jun 16, 2014 at 12:51 AM
Edited Jun 16, 2014 at 1:17 AM
OK looking at this now the images that work locally have the path


the ones that don't work only have the path


So similar to this issue?

Any images added to the live site will break when trying to create a development version because they do not contain the /OrchardLocal/ path?
Jun 16, 2014 at 2:40 AM
For example the client has added some images to a widget in the sidebar for e.g.


However restoring that path locally doesn't work - the image is missing because it needs OrchardLocal. Yes it's only a broken image path but if you're doing some styling work for example it means altering all the paths to get the page to display correctly.