forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: mika2k3 on November 10, 2003, 12:11:30 pm

Title: Moving from a server to another one ?
Post by: mika2k3 on November 10, 2003, 12:11:30 pm
Hello,

I want to move my Cpg1.2.0 from one server to another one...

- I've put on my hard disk the structure of my first server (files & folders)
- I've backup my database (file : "backup_db.sql")
- I've change "config_inc.php" to match new parameters
- I've uploaded my files & folders on 2nd server
- I want to run the "backup_db.sql" on new database via phpmyadmin

--> it gives me an error message for the table "pictures" :

Quote

CREATE TABLE ecrantot_pictures (
   pid int(11) NOT NULL auto_increment,
   aid int(11) DEFAULT '0' NOT NULL,
   filepath varchar(255) NOT NULL,
   filename varchar(255) NOT NULL,
   filesize int(11) DEFAULT '0' NOT NULL,
   total_filesize int(11) DEFAULT '0' NOT NULL,
   pwidth smallint(6) DEFAULT '0' NOT NULL,
   pheight smallint(6) DEFAULT '0' NOT NULL,
   hits int(10) DEFAULT '0' NOT NULL,
   mtime timestamp(14),
   ctime int(11) DEFAULT '0' NOT NULL,
   owner_id int(11) DEFAULT '0' NOT NULL,
   owner_name varchar(40) NOT NULL,
   pic_rating int(11) DEFAULT '0' NOT NULL,
   votes int(11) DEFAULT '0' NOT NULL,
   title varchar(255) NOT NULL,
   caption text NOT NULL,
   keywords varchar(255) NOT NULL,
   approved enum('YES','NO') DEFAULT 'NO' NOT NULL,
   user1 varchar(255) NOT NULL,
   user2 varchar(255) NOT NULL,
   user3 varchar(255) NOT NULL,
   user4 varchar(255) NOT NULL,
   url_prefix tinyint(4) DEFAULT '0' NOT NULL,
   randpos int(11) DEFAULT '0' NOT NULL,
   pic_raw_ip tinytext,
   pic_hdr_ip tinytext,
   PRIMARY KEY (pid),
   KEY pic_hits (hits),
   KEY pic_rate (pic_rating),
   KEY aid_approved (aid, approved),
   KEY randpos (randpos),
   KEY pic_aid (aid),
   KEY search (title, caption, keywords, filename)
)

MySQL a répondu:

BLOB column 'caption' used in key specification without a key length


I use Mysql 3.23.47
Can u help me please ?

Thanks,
Mika.
Title: Moving from a server to another one ?
Post by: Tarique Sani on November 10, 2003, 01:29:42 pm
Open schema.sql and replace

Code: [Select]
caption text NOT NULL,
with
Code: [Select]
caption varchar(500) NOT NULL,

That will fix it for the time being[/code]
Title: Moving from a server to another one ?
Post by: mika2k3 on November 10, 2003, 02:31:34 pm
If i use :
Code: [Select]
caption varchar(500) NOT NULL

i obtain this sql error :
Quote
Too big column length for column 'caption' (max = 255). Use BLOB instead


and if i use
Code: [Select]
caption varchar(255) NOT NULL

i obtain :
Quote
Specified key was too long. Max key length is 500


Can u help me !?
Title: Moving from a server to another one ?
Post by: sede on March 03, 2004, 10:43:18 pm
I have the same problem. Cannot restore the database.

Finally I was able to do it, when deleted the following line:
"KEY search (title, caption, keywords, filename) "
But I think it is not the best solution...

Please help!
Title: Solution
Post by: nozzz on March 17, 2004, 05:09:19 am
Hi all - maybe a bit late, but for anyone searching in the future here is the fix:

The last line of the create table SQL looks like this
KEY search (title,caption,keywords,filename)

sede mentiond it worked when he removed it, but the better option is to make the line look like this:

FULLTEXT KEY search (title,caption,keywords,filename)

I found the solution by looking in the install.php for coppermine.  The original install creates the table this way.

regards,
john
nozzz
Title: Re: Moving from a server to another one ?
Post by: mohamedimran on March 16, 2009, 07:53:05 pm
thx frnd...

http://funnyimgs.co.cc - My site

me too got this prob... but now it solved....

thx again...
Title: Re: Moving from a server to another one ?
Post by: Fabricio Ferrero on March 17, 2009, 03:58:30 am
Locking.

Edit: I tried to locking the thread....  :-\  I can't lock this thread (as I thought), neither delete my post to let someone else see this and take action. Please some with the right permissions do what is needed.
Title: Re: Moving from a server to another one ?
Post by: Joachim Müller on March 17, 2009, 07:12:01 am
@Fabricio: did as suggested. Thanks.

@all: locking.

@mohamedimran: in the future, don't post on boards that exist for reference only.