Anna Crooks wrote
I'm wondering if anyone has some hot tips on how to do a file cleanup in DNN. Primarily I'm looking for ways to identify orphan files, especially images. Also are there any ways of moving files without breaking links?
There is a table which holds the file references : the dnn_Files table (or Files, if you have no object reference). This holds an entry for each file indexed in the portals subfolders. First, I recommend using the 'synchronize files and folders' button for your site (in the file manager). This should go through and sync up the actual files on the server, with the Files table. Then, if you want to delete files, you can do so through the File Manager screen. This will keep the file system and file table in proper synchronization. THere is also a Folders table which holds the references to the individual folders on the site.
You might find success with just deleting the files you don't want, and then running the synchronization routine : most of the time this works OK, but you can get problems where the file permissions are incorrect. You can also manually delete rows in the Files table if you are confident : but beware because some modules might include indirect foreign key references to the files table. I wouldn't do this unless you really know what you're doing.
Before starting anything, take a backup and know how to restore it to get back to where you were. Then you can try with confidence.
As for moving files around : Sebastian is correct in that if you maintain the LinkClick.aspx?fileid=xyz refererence it will still work OK, but it's difficult to know if every mention of the file uses this format. It's best not to move files if you can really help it.
My final tip would be to install and use Microsoft Fiddler to trace the http requests when you're using your site. If you have any broken links from missing images /downloads, it will be much easier to trace the problems using Fiddler. Good luck.