Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Using Data From Another Database  (Read 3212 times)

0 Members and 1 Guest are viewing this topic.

PKfanSteph

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 10
    • Concert Photos @ PlayThruMe.com
Using Data From Another Database
« 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
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Using Data From Another Database
« Reply #1 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.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

PKfanSteph

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 10
    • Concert Photos @ PlayThruMe.com
Re: Using Data From Another Database
« Reply #2 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,
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Using Data From Another Database
« Reply #3 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, '', '')
Logged
Chief Geek at Ranium Systems
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.