Automated removal of dead links? Automated removal of dead links?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Automated removal of dead links?

Started by DanJ, April 18, 2005, 03:29:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DanJ

The server my site was stored on recently had a catestrophic RAID array failure which resulted in the loss of all data. The site has now been restored from a backup however the recently uploaded images are missing however the the SQL database still refers to them (independent server so no data lost). Is there a way to mass remove all dead links to the images that no longer exist?

If not is there a 3rd party tool to do so? (I guess I should post that on the other forum but I thought it polite to safe x-posting in the hope that there is already a facility I've overlooked).

Thanks to anyone who's able to provide any help, it's all appreciated.

krkeegan

Wow that sucks. I can't think of anything off hand that has been created but I think you may be able to figure something out with phpMyAdmin. If you can figure out what is the most recent photo that is still up I think you could delete all  other posts after.

The pid value in the pictures database is auto_incremented so if you can find the last good picture and remove all references to the other pictures that occur there after I think it should work.

I don't have the table structure in front of me right now, but I also think you will have to make a few mods to the other tables.

Anyone else care to check my reasoning? Is there anything I am missing?

Kevin

Of course if you had a corresponding backup of the database that would work to.
There are no stupid questions, only stupid people. -Mr. Mackey, South Park

DanJ

What you've said makes sense to me. My knowledge of SQL is poor at best but I'm sure I can write a simple enough query to report back the appropriate records.

Thanks for your help.

Nibbler

Try the attached - unzip, upload to cpg dir, and run from browser.