forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: PKfanSteph on August 21, 2005, 05:31:30 am

Title: Using Data From Another Database
Post by: PKfanSteph on August 21, 2005, 05:31:30 am
I had a problem with my database and hadn't backed up (go ahead and smack me...).  The photos are still on my server and it's easy enough to recreate the catagories and albums and batch add the photos.  But the hard part is re-entering all the other info like title, description and such.  I had the photos in another gallery with the same filenames and have a backup of those.  The only difference is the filepath.  Is there a way to get the information into the new database besides retyping it all?

Thanks,

-- Steph
Title: Re: Using Data From Another Database
Post by: kegobeer on August 21, 2005, 05:35:02 am
Use phpMyAdmin to export your albums, categories and pictures tables.  Open up the sql file and change the file paths in the pictures table data.  Import the tables into your new database.  You will then have your albums, categories, and pictures back without having to do a lot of typing.

Make sure to back up your database before attempting this.
Title: Re: Using Data From Another Database
Post by: PKfanSteph on October 28, 2005, 08:21:04 am
Thanks!  I got the albums and catagories inserted OK, but when I tried the pictures, phpMyAdmin returned the following:

------------------------
SQL query:

INSERT INTO `cpg135_pictures`
VALUES ( 1, 50, 'phil_keaggy/2005-05-28/', 'pk_01720_sbb.jpg', 77636, 82233, 600, 450, 2, '2005-10-27 18:23:57', 1124588247, 1, 'Admin', 0, 0, 'Phil Keaggy', 'Phil during soundcheck', '', 'YES', 'Stephanie Bargenquast', 'May 28, 2005', 'Del Mar Fairgrounds, Del Mar, CA', 'Sony DSC-F717', 0, 1, '', '', NULL )

MySQL said:
#1136 - Column count doesn't match value count at row 1
------------------------

Any idea what I'm doing wrong?

Thanks,
Title: Re: Using Data From Another Database
Post by: Abbas Ali on October 28, 2005, 09:20:39 am
Remove the last value i.e. NULL from the query.

So the new query will be

Code: [Select]
INSERT INTO `cpg135_pictures`
VALUES ( 1, 50, 'phil_keaggy/2005-05-28/', 'pk_01720_sbb.jpg', 77636, 82233, 600, 450, 2, '2005-10-27 18:23:57', 1124588247, 1, 'Admin', 0, 0, 'Phil Keaggy', 'Phil during soundcheck', '', 'YES', 'Stephanie Bargenquast', 'May 28, 2005', 'Del Mar Fairgrounds, Del Mar, CA', 'Sony DSC-F717', 0, 1, '', '')