coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: zyuray on June 28, 2004, 05:50:36 PM

Title: [Solved]: Problem restoring database
Post by: zyuray on June 28, 2004, 05:50:36 PM
I moved to a new server and this is what I did step by step:

On the old server, in SSH:
mysqldump gallery > gallery.sql

I transferred gallery.sql to my new server
I uploaded all Coppermine files to the new server.
I transferred all album folders to the new server into the same locations.

On the new server, in SSH:
mysqladmin create gallery

I ran the install.php script, connecting to 'gallery'
Coppermine is up and running, but blank

On the new server in SSH:
mysqladmin drop gallery
mysqladmin create gallery
mysql gallery < gallery.sql

Now this appears when I visit the site:

Fatal error :
There was an error while processing a database query

Did I do something incorrectly?
Title: Re: Problem restoring database
Post by: Nibbler on June 28, 2004, 06:12:24 PM
Check the table name prefix in config.inc.php, then enable debug mode directly in the database (config table, debug mode -> 1) and see what the failed query was.
Title: Re: Problem restoring database
Post by: zyuray on June 28, 2004, 06:27:14 PM
I enabled debug mode, and it told me that the "cpg_filetypes" table was missing, which was true - it was not in the database after the restore.

I copied the entire cpg_filetypes table from a fresh Coppermine installation, and now I get this:

Notice: Undefined index: allowed_doc_types in /home/rbase/public_html/include/media.functions.inc.php on line 38

Notice: Undefined index: allowed_doc_types in /home/rbase/public_html/include/media.functions.inc.php on line 38

Notice: Undefined index: allowed_doc_types in /home/rbase/public_html/include/media.functions.inc.php on line 38

Notice: Undefined index: allowed_doc_types in /home/rbase/public_html/include/media.functions.inc.php on line 38

Notice: Undefined index: user_group_list in /home/rbase/public_html/include/init.inc.php on line 273
Fatal error :
There was an error while processing a database query
Title: Re: Problem restoring database
Post by: Nibbler on June 28, 2004, 06:40:39 PM
Run the update.php.
Title: Re: Problem restoring database
Post by: zyuray on June 28, 2004, 06:52:55 PM
Thanks.

Looks like I was restoring a 1.2.1 db onto a 1.3.0 installation.

Oopsie
Title: Re: Problem restoring database
Post by: zyuray on June 28, 2004, 07:20:06 PM
Ok, so I restored everything with 1.2.1 and it worked fine. Then I followed the upgrade 1.3.0 directions. After running update.php, the following occurs:

While executing query "SELECT cid, name, description, thumb FROM cpg_categories WHERE parent = ''  ORDER BY pos" on 0

mySQL error: Unknown column 'thumb' in 'field list'
Title: Re: Problem restoring database
Post by: Nibbler on June 28, 2004, 07:37:10 PM
Adding the thumb column should be done by update.php, make sure the user you are running coppermine under has permission to do ALTERS on your database.
Title: Re: Problem restoring database
Post by: zyuray on June 28, 2004, 07:47:47 PM
The user does have alter privileges.
This is all the update.php file reports doing:

ALTER TABLE cpg_comments add msg_raw_ip tinytext Already Done
ALTER TABLE cpg_comments add msg_hdr_ip tinytext Already Done
ALTER TABLE cpg_pictures add pic_raw_ip tinytext Already Done
ALTER TABLE cpg_pictures add pic_hdr_ip tinytext Already Done
INSERT INTO cpg_config VALUES ('thumb_use', 'any') Already Done
INSERT INTO cpg_config VALUES ('show_private', '0') Already Done
INSERT INTO cpg_config VALUES ('first_level', '1') Already Done
INSERT INTO cpg_config VALUES ('display_film_strip', '1') Already Done
INSERT INTO cpg_config VALUES ('max_film_strip_items', '5') Already Done
INSERT INTO cpg_config VALUES ('comment_email_notification', '0') Already Done
CREATE TABLE cpg_banned ( ban_id int(11) NOT NULL auto_increment, user_id int(11) DEFAULT NULL, ip_addr tinytext DEFAULT NULL, expiry datetime DEFAULT NULL, PRIMARY KEY (ban_id) ) TYPE=MyISAM Already Done
Upgrade completed
Coppermine is now upgraded and ready to roll.


Let's continue !
Title: Re: Problem restoring database
Post by: Nibbler on June 28, 2004, 07:58:09 PM
You are using the 1.2 version of update.sql - all your files have to be the 1.3 version.
Title: Re: Problem restoring database
Post by: Casper on June 28, 2004, 07:59:49 PM
Can you check the database to see if it has been created.  'already done' is given when the action is not required, but also when the action fails.
Title: Re: Problem restoring database
Post by: zyuray on June 28, 2004, 08:43:14 PM
Re-verified my steps. All works now. Thanks guys