Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: 1 [2]

Author Topic: [UPGRADE] database 1.4 to 1.5 SQL upgrade  (Read 17010 times)

Zucye

  • Sr. Member
  • ****
  • Karma: 5
  • Posts: 347
    • Simplemente una Mujer
[UPGRADE] database 1.4 to 1.5 SQL upgrade
« Reply #15 on: December 04, 2006, 11:39:09 PM »

I am very confused  :/
Do I need to do the first part or the second part?
Or do I have to do both?

I was testing 1.5 the first release - back in September.  Today I installed the new release and now I cannot login.  Is that because I didn't change the data base (I haven't because I am not sure how).   I did change the variables correctly in the snews.php
Logged
We can always learn from our failures, not so much from obvious success - C. Robinson (W. Disney). :)

Zucye

  • Sr. Member
  • ****
  • Karma: 5
  • Posts: 347
    • Simplemente una Mujer
[UPGRADE] database 1.4 to 1.5 SQL upgrade
« Reply #16 on: December 04, 2006, 11:48:33 PM »

Now.. this is what I did:

I backed up my snews 1.4 and restore it to a new database.  I changed the variables in snews.php and applied the 1st fix.  and I get a horrible mess in the site: http://www.zucye.net/ and also got the following error at phpmyadmin

Code: [Select]
Error
SQL query:

ALTER TABLE articles MODIFY id int( 11 ) PRIMARY KEY AUTO_INCREMENT ,
DROP textlimit,
MODIFY position int( 6 ) ,
DROP image,
ADD description_meta varchar( 255 ) default NULL ,
ADD keywords_meta varchar( 255 ) default NULL ;

MySQL said:  

#1068 - Multiple primary key defined
-----------------------------------------------


Dont mind the following error (my mistake.  I applied it to the wrong database)
#1091 - Can't DROP 'textlimit'. Check that column/key exists
Logged
We can always learn from our failures, not so much from obvious success - C. Robinson (W. Disney). :)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
[UPGRADE] database 1.4 to 1.5 SQL upgrade
« Reply #17 on: December 05, 2006, 01:18:49 AM »

If you already had a 1.5 database, then you would not apply the upgrade since it is only meant to upgrade from 1.4 to 1.5. As to why the upgrade has a problem dropping the textlimit column in a 1.4 databse... I don't know. Mika is the one who should be able to answer this one.

Which Part to Use: Here is what I THINK one would do. If your the tables in your 1.4 database are named as they were by default - articles, categories and comments - you would use the First part. If you had added prefixes to your tables when you created them, then you would use the Second part and you would replace the 14 and 15 prefixes (in all places where they are) with your prefix(es). That way the script will be able to located your existing tables by their prefixed names and would then modify them to your new prefixed name. The prefixes, of course, would be those that you also have within the prefix variable in your configuration settings at the tops of their snews.php files.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Zucye

  • Sr. Member
  • ****
  • Karma: 5
  • Posts: 347
    • Simplemente una Mujer
[UPGRADE] database 1.4 to 1.5 SQL upgrade
« Reply #18 on: December 05, 2006, 05:13:14 AM »

Quote from: keyrocks
Here is what I THINK one would do. If your the tables in your 1.4 database are named as they were by default - articles, categories and comments - you would use the First part.
I used the default names: articles, categories, comments.  So I used the 1st part, but I got a horrible mess.

I should also note, that I uploaded the rest of the files within the package sNews1.5.  Making the appropiate changes.

**I tried Mikas suggestion of comenting the following line:
ALTER TABLE articles
-- some versions of mysql* don't support this method of primary key/index setup very well
-- MODIFY id int( 11 ) PRIMARY KEY AUTO_INCREMENT,
DROP textlimit,
-------------------------------

and got the following message:
Code: [Select]
Error
SQL query:

ALTER TABLE articles-- some versions of mysql* don't support this method of primary key/index setup very well
-- MODIFY id int( 11 ) PRIMARY KEY AUTO_INCREMENT,
DROP textlimit,
MODIFY position int( 6 ) ,
DROP image,
ADD description_meta varchar( 255 ) default NULL ,
ADD keywords_meta varchar( 255 ) default NULL ;



MySQL said:  

#1091 - Can't DROP 'textlimit'. Check that column/key exists
Logged
We can always learn from our failures, not so much from obvious success - C. Robinson (W. Disney). :)

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
[UPGRADE] database 1.4 to 1.5 SQL upgrade
« Reply #19 on: December 05, 2006, 06:01:27 AM »

You're trying to run that upgrade on the same table, right? Then remove both DROP statements (textlimit and images) from the sql code as well - those columns were removed in your previous upgrade attempt.

Another approach would be to make another copy of your backup table and to run the sql code without MODIFY id statement.
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

Zucye

  • Sr. Member
  • ****
  • Karma: 5
  • Posts: 347
    • Simplemente una Mujer
[UPGRADE] database 1.4 to 1.5 SQL upgrade
« Reply #20 on: December 05, 2006, 04:51:41 PM »

Quote from: Mika
You're trying to run that upgrade on the same table, right? Then remove both DROP statements (textlimit and images) from the sql code as well - those columns were removed in your previous upgrade attempt.
Did that.  Now I get the following error:
Code: [Select]
Error
SQL query:

ALTER TABLE categories MODIFY id int( 11 ) PRIMARY KEY AUTO_INCREMENT ,
MODIFY name varchar( 100 ) ,
MODIFY description varchar( 255 ) ,
ADD catorder smallint( 6 ) NOT NULL default '0';

MySQL said:  

#1068 - Multiple primary key defined
I have not try the following yet.
Quote from: Mika
Another approach would be to make another copy of your backup table and to run the sql code without MODIFY id statement.
You mean, that I should remove all the instances of "MODIFY id"???  

This are my versions:
localhost
Server version: 4.0.25-standard
Protocol version: 10
Server: Localhost via UNIX socket

phpMyAdmin - 2.9.0.2
MySQL client version: 4.1.10
Used PHP extensions: mysql
Logged
We can always learn from our failures, not so much from obvious success - C. Robinson (W. Disney). :)

Zucye

  • Sr. Member
  • ****
  • Karma: 5
  • Posts: 347
    • Simplemente una Mujer
[UPGRADE] database 1.4 to 1.5 SQL upgrade
« Reply #21 on: December 05, 2006, 10:56:49 PM »

Quote from: Mika
Another approach would be to make another copy of your backup table and to run the sql code without MODIFY id statement.
Ok, it seems like it worked.  I deleted all the tables and uploaded a fresh copy of the backed up file.  Then applied the first approach removing all the "MODIFY id.." 3 in total.  Now I am back to the problem with the Spanish characters and the design was a mess, so I used the default one for the time being. But that is another topic!

I will test it later ... (most likely tomorrow)
Logged
We can always learn from our failures, not so much from obvious success - C. Robinson (W. Disney). :)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
[UPGRADE] database 1.4 to 1.5 SQL upgrade
« Reply #22 on: December 06, 2006, 04:26:25 PM »

Quote from: Zucye
Ok, it seems like it worked...  Now I am back to the problem with the Spanish characters and the design was a mess, so I used the default one for the time being. But that is another topic!
I will test it later ... (most likely tomorrow)
This is just a hunch... but when you created your database, did you end up creating it with a charset that was different from the one you had on your default database? Character messes usually result when the charset used in the database and tables is not compatible with the language characters being used in the content.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Zucye

  • Sr. Member
  • ****
  • Karma: 5
  • Posts: 347
    • Simplemente una Mujer
[UPGRADE] database 1.4 to 1.5 SQL upgrade
« Reply #23 on: December 06, 2006, 09:58:09 PM »

Your were right Keys (like always).  I change it to " ISO-8859-1"  and it looks good know :D
Logged
We can always learn from our failures, not so much from obvious success - C. Robinson (W. Disney). :)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
[UPGRADE] database 1.4 to 1.5 SQL upgrade
« Reply #24 on: December 07, 2006, 04:07:47 AM »

Quote from: Zucye
Your were right Keys (like always).  I change it to " ISO-8859-1"  and it looks good know :D
Noticias excelentes! Alegre estar de una cierta ayuda.  :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Tehy

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 65
    • http://www.sefanatics.com
[UPGRADE] database 1.4 to 1.5 SQL upgrade
« Reply #25 on: December 11, 2006, 07:27:00 PM »

Ok, now I have done the update (in test page). Looks like there is few problems:

- There is no "read more" button :/ How can I add that?
- How I show news from all categorie in index page?

brauck

  • Hero Member
  • *****
  • Karma: 18
  • Posts: 556
    • http://www.hbw-webdesign.nl/
[UPGRADE] database 1.4 to 1.5 SQL upgrade
« Reply #26 on: December 11, 2006, 08:44:41 PM »

did you searched the forum Tehy?

I know that your questions are asked before and, more important, that the are solved :)
Logged
Confidence is reduced complexity.
brauck.nl for free css templates

mike1

  • Full Member
  • ***
  • Karma: 6
  • Posts: 199
[UPGRADE] database 1.4 to 1.5 SQL upgrade
« Reply #27 on: December 24, 2006, 05:02:18 AM »

so, i tried this and it didnt work.  heres what i ended up pasting into phpmyadmin after removing all the lines that gave me errors

Code: [Select]
ALTER TABLE articles
MODIFY position int(6),

ALTER TABLE categories
MODIFY name varchar(100),
MODIFY description varchar(255),
ADD catorder smallint(6) NOT NULL default '0';

ALTER TABLE comments
ADD url varchar(100) NOT NULL,
ADD approved varchar(5) NOT NULL default 'True';

CREATE TABLE settings (
    id int(8) primary key auto_increment,
    name varchar(20) NOT NULL,
    `value` varchar(60) NOT NULL
);

    INSERT INTO settings VALUES (1, 'website_title', 'sNews 1.5');
    INSERT INTO settings VALUES (2, 'home_sef', 'home');
    INSERT INTO settings VALUES (3, 'website_description', 'sNews CMS');
    INSERT INTO settings VALUES (4, 'website_keywords', 'new, site, snews');
    INSERT INTO settings VALUES (5, 'website_email', 'info@mydomain.com');
    INSERT INTO settings VALUES (6, 'contact_subject', 'Contact Form');
    INSERT INTO settings VALUES (7, 'language', 'EN');
    INSERT INTO settings VALUES (8, 'charset', 'UTF-8');
    INSERT INTO settings VALUES (9, 'date_format', 'd.m.Y. H:i');
    INSERT INTO settings VALUES (10, 'article_limit', '3');
    INSERT INTO settings VALUES (11, 'rss_limit', '5');
    INSERT INTO settings VALUES (12, 'display_page', '');
    INSERT INTO settings VALUES (13, 'display_new_on_home', '');
    INSERT INTO settings VALUES (14, 'display_pagination', '');
    INSERT INTO settings VALUES (15, 'num_categories', 'on');
    INSERT INTO settings VALUES (16, 'approve_comments', '');
    INSERT INTO settings VALUES (17, 'comments_order', 'ASC');
    INSERT INTO settings VALUES (18, 'comment_limit', '30');
    INSERT INTO settings VALUES (19, 'word_filter_enable', '');
    INSERT INTO settings VALUES (20, 'word_filter_file', '');
    INSERT INTO settings VALUES (21, 'word_filter_change', '');
    INSERT INTO settings VALUES (22, 'username', 'test');
    INSERT INTO settings VALUES (23, 'password', '098f6bcd4621d373cade4e832627b4f6');
and then i got the error

Code: [Select]
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TABLE categories
MODIFY name varchar(100),
MODIFY description varchar(255),
A' at line 4
my mysql version is 4.1.21-standard

i removed
Code: [Select]
DROP textlimit,
DROP image,
because the fields werent available

*EDIT* ive looked at the dumo log and the table structure, and these two fields are there.
and
Code: [Select]
ADD description_meta varchar(255) default NULL,
ADD keywords_meta varchar(255) default NULL;
becasue they both gave me duplicate column names

i tried with and without the modify ids, and it still doesnt work.  ideas?
Logged
Pages: 1 [2]