coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: phill104 on July 31, 2007, 10:46:12 AM

Title: Moving all images from one album to another
Post by: phill104 on July 31, 2007, 10:46:12 AM
Once every 6 months I move older images from one folder into an archive folder*, remove the old album and create a new one. At the moment I have to move each file individually which is quite time consuming. Is there a simple way to move all files from one album to another?

*It is a windsurfing website so each season gets replaced with a new one and any more than 4 seasons ago get archived in an album rotation sort of way.

http://www.windsurf.me.uk (http://www.windsurf.me.uk)
Title: Re: Moving all images from one album to another
Post by: Nibbler on July 31, 2007, 10:56:22 AM
Assuming you mean 'album' and not 'folder', the simplest way is to run an SQL query.

UPDATE cpg_pictures SET aid = <newaid> WHERE aid = <oldaid>

Replace <newaid> <oldaid> and cpg_ as appropriate, backup the table before running.
Title: Re: Moving all images from one album to another
Post by: phill104 on July 31, 2007, 07:23:16 PM
Cheers Nibbler. It worked a treat ;D.

Title: Re: Moving all images from one album to another
Post by: madhatt on August 01, 2007, 09:00:50 PM
Thanks Nib, works great for me too.