News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

upgrade database

Started by Omebolle, April 22, 2019, 09:04:58 AM

Previous topic - Next topic

Omebolle

When trying to add a board to the forum, I get this message:
It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.15, while your database is at version 2.0.9. The above error might possibly go away if you execute the latest version of upgrade.php.
I cannot figure out how to do that

Bigguy

This may help.

Upgrading SMF

EDIT: Is this in the wrong board. ??

Omebolle

#2
Why doesn't the database automatically upgrade along with the installed version? I have 2.0.15 installed, database stayed back at 2.0.9?

I saw that page, but I'm not an expert and hesitated to just paste files into a working forum (except for the database it seems).

Ah, I see, wrong board :-\

Doug Heffernan

Well, they say that there are not any database changes and therefore running the upgrader is not needed. But the question is why the error message says otherwise. If I were you I would either run the upgrader anyway, or change the smf version manually in the smf_settings to reflect that of the files. i.e. 2.0.15.

Omebolle

Quotethe smf version manually in the smf_settings to reflect that of the files. i.e. 2.0.15

No idea where to do that, sorry.

SychO

Check your error log, past all of the error message
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Omebolle

This?    
Reverse chronological order of list Today at 01:27:42 PM
Apply Filter: Only show the error messages of this session d848b8ec01af5307213e3b950512d00c
Apply Filter: Only show the errors of this type Type of error: Database
Apply Filter: Only show the error messages of this URL
http://xxx.xxx.php?action=admin;area=manageboards;sa=board2
Apply Filter: Only show the errors with the same message
Database Error: Field 'passwd' doesn't have a default value
Apply Filter: Only show the errors from this file
File: /customers/1/f/5/xxx.xxx/Sources/Subs-Boards.php
Line: 778

SychO

Are you using or used some kind of board password mod ?

You need to go into the database using phpMyAdmin and then to the smf_boards table and then you need to give the "passwd" column a default value, or you can delete the column if you're no longer using the mod (be careful though)
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Omebolle

Not sure what a password board is, didn't install a mod like that.
But now I see it in the files of the forum, not in the package manager.



Omebolle

btw that error log has more than 330.000 errors logged... Should I delete?

SychO

Quote from: SychO on April 22, 2019, 10:31:42 AM
You need to go into the database using phpMyAdmin and then to the smf_boards table and then you need to give the "passwd" column a default value, or you can delete the column if you're no longer using the mod (be careful though)
^
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Doug Heffernan

Quote from: Omebolle on April 22, 2019, 10:48:15 AM
btw that error log has more than 330.000 errors logged... Should I delete?

If you are not using that mod anymore, then you can delete that field altogether from the smf_boards table.

Omebolle


Quote from: SychO on April 22, 2019, 10:31:42 AM
You need to go into the database using phpMyAdmin and then to the smf_boards table and then you need to give the "passwd" column a default value, or you can delete the column if you're no longer using the mod (be careful though)

I'm a rookie, not even sure what you mean here, "you need to go into the database using phpMyAdmin"
How?

SychO

Well you should be able to access it from your cpanel,

You can also ask your host to disable mysql strict mode
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Sir Osis of Liver

Did you put html in any of your board names or descriptions?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Omebolle

#15
html... don't think so...

Is this the passwordboard you mentioned? where do I change that "default value"
As I said, this is all new to me
I just contacted the host and asked to disable the mysql strict mode

Illori

it is in the database not in the files. you would need to get into your database. if you don't know how ask your host if they can help you out.

Kindred

first... the "database version" error message is a red herring and is incorrect. Ignore it.

second... the ACTUAL issue is (as pointed out) with a mod that you have installed -- whether it's in the package manager or not, that mod WAS installed and the database column was added.

So, you have two choices.
If you are CERTAIN that the mod has been uninstalled, then you can remove the database column "passwd" from the smf_boards table.

If not, you can go into phpmyadmin (it's a function of the host, usually in the hosting cpanel which allows you to view and edit the database)
and give the "passwd" column a default value of NULL.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Omebolle

As I said before, I'm just an amateur when it comes to this kind of stuff. I never installed a password board mod.
It isn't in my "package manager"
Tried to find what you suggested through my CP, and this is what I could find, this is what you meant? Can't find a passwd column

below that is a mention of my SQL server only being active since yesterday? No idea what that means, the forum has been running for several years now

Kindred

well then... what are lines 770-780 of Subs-Boards.php



File: /customers/1/f/5/xxx.xxx/Sources/Subs-Boards.php
Line: 778
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Omebolle

#20
Wow, think I found it, you mean this?
// Insert a board, the settings are dealt with later.
$smcFunc['db_insert']('',
'{db_prefix}boards',
array(
'id_cat' => 'int', 'name' => 'string-255', 'description' => 'string', 'board_order' => 'int',
'member_groups' => 'string', 'redirect' => 'string',
),
array(
$boardOptions['target_category'], $boardOptions['board_name'] , '', 0,
'-1,0', '',
),
array('id_board')

Kindred

so, there is no insert there for the passwd column...   which means whatever mod you had is probably uninstalled...

however, the error clearly shows that there IS a passwd column in the smf_boards table...

So, if you can't see one in phpmyadmin, then that suggests that either you are looking at the wrong database or something is hokey
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Omebolle

First of all, thanks for trying to help..
As I said, I am a rookie, I stayed far from trying to install complicated stuff...
I can't remember I ever tried to or did install a mod where you have to use a password to get into a board (nowhere to be seen in downloaded packages) It almost looks like it came with the board I installed?.
I use member groups for certain boards (always have). Therefore I have NO idea how the files of a password board came up in. What I did notice however is that the files have the SAME timestamp as the date I first installed the forum (see list). Never had any problems adding new boards in the years after, so why now?
Are there other files you want me to check? The second screen is of my CP on the server One.com and the link where I looked up the file you asked me to

Omebolle

Finally... Didn't understand what you meant with this "File: /customers/1/f/5/xxx.xxx/Sources/Subs-Boards.php"

Now I went to check through Filezilla which I use to upload files to the website and there I recognized the path you mentioned. There I can indeed see the PasswdBoard.php in the files with the 2014 date
This is the code I see in the Subs-Boards.php there, but I cannot open it with line numbers visible, only with notepad

Insert a board, the settings are dealt with later.
$smcFunc['db_insert']('',
'{db_prefix}boards',
array(
'id_cat' => 'int', 'name' => 'string-255', 'description' => 'string', 'board_order' => 'int',
'member_groups' => 'string', 'redirect' => 'string',
),
array(
$boardOptions['target_category'], $boardOptions['board_name'] , '', 0,
'-1,0', '',
),
array('id_board')
);
$board_id = $smcFunc['db_insert_id']('{db_prefix}boards', 'id_board');

if (empty($board_id))
return 0;

// Change the board according to the given specifications.
modifyBoard($board_id, $boardOptions);

// Do we want the parent permissions to be inherited?
if ($boardOptions['inherit_permissions'])
{
getBoardTree();

if (!empty($boards[$board_id]['parent']))
{
$request = $smcFunc['db_query']('', '
SELECT id_profile
FROM {db_prefix}boards
WHERE id_board = {int:board_parent}
LIMIT 1',
array(

Tonyvic

The editor I use is Notepad++ and it will show line numbers. :)
https://notepad-plus-plus.org/download/v7.6.6.html

Omebolle

#25
Thks, will try that, but I'm pretty sure that's the part Kindred was talking about before (edit: Yep, just checked with that new notapad)

Kindred

#26
Yes, that file and code....

Welcome to the world of webmastering.

So, because the files are there, the PasswdBoard.php in the Sources and the PasswdBoard.template.php in the themes directories, that does prove that you HAD the mod installed at some point.   We won't even bother to figure out why or when, since it's not relevant.
https://custom.simplemachines.org/mods/index.php?mod=2873

In Subs-Boards.php do a search for 'passwd' ---  if it is not present anywhere in that file, then the mod was uninstalled.

However, many mods, even when uninstalled, leave behind files and database edits.

So, the problem is not in your files.
the problem is in yoru database.

the passwd column is there. Even though your previous screen shot did not show it, your SYSTEM knows it is there -- and it does not have a default value.  That's really the only problem.
Why did this start happening now when it was not happening before?  Because your host upgraded to a version of mySQL that requires it or turned on STRICT mode...   and the mod was sloppily coded and did not set a default value (since it was not required in previous versions of mySQL)

So, you have to find the passwd column in the smf_boards table.
Then you have to set a default value of NULL for that column
-poof- your issue will be solved...   but you have to find the column first. ;)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

That link contains no reference to the package...

Kindred

dunno what you're talking about, man....   :P

(yes, link fixed)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Omebolle

Think I got to the right place, Control Panel- PHPMyAdmin-smf-boards.. but cannot find anything about passwd

Kindred

so....  you are correct.
The picture does not show and passwd column.

However, the mod DOES add one...

$smcFunc['db_add_column']('{db_prefix}boards', array('name' => 'passwd', 'type' => 'varchar', 'size' => 64), array(), 'ignore');

and your error indicates that your system is seeing it.

My only suggestion is ---  are you certain that when you go into phpmyadmin, that you are viewing the correct database?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Omebolle

Only have one database as far as I know, only one comes up when I want to select which one to open

You're right, wrong file. One database, but the forum is in another section, I have it in a folder called test. So I needed the "test_boards" file and there it is (line 17), but how to change the value to NULL?

Sir Osis of Liver

If the mod is no longer installed, just click 'Drop', that will remove the column.  Or you can add null value by clicking 'Edit'.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Omebolle

will try, thanks
Edit; Worked like a charm, new board added without problems.

Thanks for the help people 8)

Advertisement: