![]() |
Restoring Deleted Images (over 1000) Chuck, When I go into the maintenance selection in admincp and run the tool to find the orphaned files, it runs out of memory, most likely because I had a user with over 2000 images in the gallery delete the vast majority of them. Through my ISP I was able to get the images back and retore them to his directory /gallery/files/1/2/3/4 etc. What is the best way now to get them to show back up in the gallery itself? |
Well this all depends... do you want to reassign them to that user? Or just to another user? to yourself? What I would personally do... is FIRST: get the images out of his directory... (because if you run the maintenance tool they will get deleted again) either: all to your harddisk with ftp (recommended) or: create a subdirectory in directory users with YOUR userid (probably 1) in this directory you copy all images except those ending with *_thumb.* Then open your forums/admincp/vba_gallery_admin.php (i think thats the filename.. - not at home so i cant check - but if its not, its very similar) find right at top: error_reporting(E_ALL & ~E_NOTICE); add: ini_set("max_execution_time", 0); ini_set("memory_limit", "20M"); and then run mainenance tool... there are chances it will not timeout... then click fix errors... (this will delete images if db entry is missing.. or db entry if image is missing) as the user deleted the images, there are good chances that the db entries are gone.. now copy all the images you want to reupload into your user directory gallery/users/1 (assuming you are admin and 1 is your userid - it must be your userid) then go to upload.. and enter the users name... in upload as user field And check the bulk upload thing at the bottom of the page.. then click upload.. (try 10 images per page..) and click process 200 times.. until all is uploaded.. the image title will always be the image filename if you left title empty.. The problem is... As you say the user deleted them himself.. i dont see how to restore the image titles as they are no longer in the db and you dont know how the user called them. also description and comments are gone as the user deleted the image... Maybe there is a better way of doing it..but thats my 2 cents.. Luc |
Luciano, Thank you for the suggestions and that was somewhat along the lines of what I think I need to do. First, I've removed that user's ability to delete photos. Second, I had my ISP restore all of the deleted photos back into the folder where he deleted them from. Third, I did FTP them to my local hard drive for safekeeping, but I have not put them into another folder on the server because I didn't upload the photos, they really shouldn't be assigned to my user account, I'm "OK" with them still being assigned to the original user's account just so long as he can't delete them. Fourth, I currently have the Flash Uploader enabled, because of this I would have to turn the Flash uploader off as there is no option that shows up to upload from the server if the FLash uploader is active, that's not a problem, I just need to turn it off, perform these restoration actions, and turn it back on when I'm finished. I am curious though, and maybe Chuck can answer this, can I process files from the server if they are in his directory and not mine or would I need to log in as him, give myself admin access, perform the upload, then remove the admin access from his account? So it looks like I'm "part" of the way there with this procedure thus far but I want to see what Chuck has to say/recommend before actually proceeding. In the mean time I will make those ini_set changes. Thanks! |
Well if I understand the functionallity correctly.. you put them into folder users/1, and in the field "upload as user" you enter the username of the user.. As to my understanding.. they will be uploaded as if it were that user... - just tested.. Just uploaded 10 images to users/1 ( I am userid 1 => Luciano) I entered in upload as user : Johnny the 10 images were assigned to Johnny, they appear as his images, also in his profile. Luc If you upload them to users/25 (25 being the userid of Johnny) you will NOT be able to access them... only johnny will IF he has the permission set in usergroup.. BEWARE.. the restored images are imagecount X3 Original, normal, thumbnail.. if you reupload all images, each of them will be a new image.. |
When you say if I put them in users/25 for Johnny that I won't be able to access them what do you mean? I will be able to see them and edit them in Johnny's gallery, as well as I could always get to them via FTP, so I'm not understanding what you meant by not be able to access them. I understand about wanting to get rid of the thumbnails as well as any reduced versions if there are originals or the number will expand by 3x! :) |
no sorry.. misunderstanding.. with access I meant bulk upload.. i meen images in users/25 can only be bulk-uploaded by user johnny.. it is impossible for admin (userid = 1) or any other user to bulk-upload images from users/25. This can only be done by user with userid 25... thats all... Sorry for confusion.. I wrote that so that you know.. that if you are userid = 1 you have to put images in directory users/1 so you can bulkupload EVEN if you want to upload as user with userid 25... thats all... Luc Once they are uploaded, they will automatically change location from users/25 to files/25 once they are in files/25 admin can view and edit them via johnny's gallery.. |
Got it, what I think I might do, is use my admin (1) account and put the photos in that user/1 directory and upload as the member. My account is (3), but I have full access to the 1 account. Reminds me I need to look up what 2 is... :) |
test with 1 or 2 images... but if account 3 has admin rights.. then just put them in users/3 |
Chuck, Any thoughts/recommendations on this? |
I would do as Luciano has suggested bulk upload them as you or some user you create to house those images. |
Ok I am still having the problem when I run Scan Database to try to get rid of orphans, etc. that despite adding in the memory settings suggested above I still get the following error: Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 71 bytes) in /drive3/blahblah/rootblah/includes/adminfunctions_gallery.php on line 256 Do I need to add those settings to that file too? |
Ugh tried adding those settings to the file and I still get the same error, the line in the file in question is: return $ofiles; Any more thoughts Chuck on how I can get this to work and clean up the orphans? |
Have you tried imagemagick? GD2 usually has all sorts of memory issues since it is part of PHP. |
| All times are GMT -5. The time now is 02:04 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0