I have an Umbraco (v6.1.6) website, hosted on Azure Hosted (Website & DB).
Recently the client reported, that some images have disappeared from the website!
Looking at the CMS back office, the content nodes are referencing media items, but 'some' of those items are no longer present in the media section! The media files are however present on the web server in the /media folder as expected!
Now, this should be running as a single instance site, but looks like the site was run in with multiple(3) instances for a while, such as when the missing images were loaded.
[All the unaffected media has lower id’s (<10000) while the missing items in the media section have higher ids (20000’s or 50000’s)]
The site is now back to running one instance.
Q. Is there a way I can re-generate the items in the Umbraco Media section, based on the media actually present in the /Media folder?
What you need to do depends a lot on the state of your site and what has been going on while it was running in 3 instances... and what you want the outcome to be!
Metadata for media in umbraco is stored in the database and the actual files are stored on disk. If your site has been running in 3 instances using the same database but different file locations on disk, you should actually be seeing that the media items exist in the database even though the files might be scattered in the 3 instances on the file system.
It however sounds like you're saying that the files all do exist on disk, but the media items not all exist in the database. Can you confirm this (as it sounds really strange unless you have been running 3 different databases also).
All in all, everything here sounds really strange since running 3 instances should also require you to have had this running and accessed by the editors uploading the files, using 3 different hostnames?
No matter what I don't think theres a simple solution to your problem. There's no way to have umbraco "reindex" the media folder based on the files there. What I have done for broken media libraries (usually self inflicted breakage, that is) is to load up all existing media items in memory and then loop through the file system to see what is missing from the library and recreate those media items and upload the files to them. Do remember to log which files you are recreating as media items so you can do a file system delete of the orphaned files after they have been processed.
If you can shed a bit more light on the issue, I will see if I can come up with a better solution for you.
Related
I'm developing a MVC5 web app, hosted through azure, that lets you manage your movies (it's just for myself at the moment). I'm trying to find a way to scan a local folder on the users pc for a list of file names. I do realise the security/permissions issues I might run into. I do not need the file uploaded, only the full file name.
It would work by the user being able to select a folder where they store their movies and it will take in all the file names, including the ones in any sub directories.
I tried a multiple file upload form but quickly ran into issues with the max request limit which I tried messing around with but it proved redundant in the end. I can settle for the user selecting multiple files but would rather it done the directory way.
I know this might prove impossible in the end but any help would be greatly appreciated.
I got an app I'm working on that uses static data from a sqlite database to do various things, While I only need read only access to the database, depending on the episode they pick from the first screen I want it to use a different database file and I want the list of available episodes to be updateable on the fly. and I got help to get the list of available episodes updated, and the proper content downloaded and stored in separate folders, So I know I could when the episode is selected delete the sql file in the documents folder and copy in the new one each time and that would work well enough for what I'm trying to do. but it seems like a bit much extra work to have to check for file, delete file, copy in new one. then open it from there each time the user wants to pick a different episode. and I don't want to put all the sql files together as that will be a bigger hassle then the first route especially if this app stays around long enough to have a long list of episodes.
so my question here is: can I get at least read-only access to an sql file that I've downloaded (or one in the bundle for testing) with out having to first copy it to the documents? and if so how would i open the file?
Can I get at least read-only access to an SQL file that I've downloaded (or one in the bundle for testing) without having to first copy it to the documents directory?
Yes. Files in the app bundle are readable (if they weren't, there would be no point in storing files in the bundle).
And if so, how would I open the file?
It's not clear what you're asking here - if you want to perform SQL queries on the file, you should use the sqlite3 library which is available on iOS.
I'm trying to setup a iPad app to work offline. I was able to successfully get it to work but I was told to put the app in multiple sub directories. When I did this and update the cache manifest file to the new destinations of all the files I kept getting an error that the site wouldn't work because it wasn't connected to the internet. I tried multiple paths and looked up different ideas but have come up empty handed. Is their a way to get offline mode working with a site inside sub directories?
Thanks.
This shouldn't make a difference. Make sure all urls in the manifest are relative and always end the manifest with:
NETWORK:
*
Furthermore make sure you don't forget to add any images, libraries etc. from the cached url's to the manifest. Sometimes even caps can make a difference. OPen the console of the developer tools in Chrome to see what's being cached and what breaks loading the appcache.
Also make sure there are no iframes (ie. like-buttons) on the homepage(page that includes the manifest attribute in the html-tag) which is always cached.
Little trick:
If you want to fallback you're homepage place the manifest attribute in an invisible iframe on the homepage of your app.
That way you have total control over what's cached and what not.
I haven't yet setup version control (GIT) for my development and production environments as a result I am facing trouble syncing everything. My site is powered by Drupal 7.
For example, for a Content type that I created, what exactly is the folder on my development site that I should be uploading. And as far as the content type I created, what folder should I be uploading to the live server?
Another case is where I make changes to 'Text formats' found in admin -> configuration and a couple of other places in admin -> configuration, well, Not sure what folder I should be uploading either.
Thanks much people!
P.S: Feel free to give me some slack for not setting up GIT or version control, lesson learnt but for now I need to get this uploaded
Thanks!
You don't need to upload any files/folders for the situations you've described, all content type and text format data is stored in the database.
Content type data is stored in the node_type table, and text formats are stored in the filter_format table.
Further data relating to both are stored in the variables table as serialised strings.
Hope that helps
I'm working on cleaning up an old Rails 2.3.5 app that uses Dragonfly to store its images.
I have a feeling there are far more images in the filestore than records in the database, but due to Dragonfly's less than transparent naming scheme I have no idea how to find out which files in the filestore belong to actual records.
Anyone have a good idea how I can clean this up? I'd love to get rid of several gigabytes of unused data.
You could look up the media records in your database where you should find a column postfixed with "_uid". This column contains the relative path to your media files in your media folder. You could then remove the files that cannot be found in your database. Be careful: as I can see there is one additional file postfixed ".extra" per media file that you should keep (but I don't know what it is for).
I am thinking about implementing such a functionality with a "Cleanup media data store" Button in my admin interface. I didn't try this out yet, though.