News:

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

Main Menu

Inherited old SMF forum

Started by ghaniba, August 29, 2022, 07:57:48 AM

Previous topic - Next topic

ghaniba

Hi Folks,

I've inherited an old SMF forum.  I was asked to assist when it got a http error 500. I've got access to the host via SSH & ftp, so full access to files.  I verified it has a database it's pointing to, IP/creds match properly.  I'm guessing it was either compromised or a php version upgrade on the hosting platform happened, knocking it down.  I'm not even positive it's a 1.1 branch, but I see this in changelog.txt:

Changelog started January 1, 2004; Currently at $Revision: 1.2111.2.470 $.

SMF 1.1.4                                                                    ???
================================================================================
September 2007
--------------------------------------------------------------------------------

Also, it appears it's running a much newer version of PHP than what I'm seeing on the forum is supported -- perhaps this is the issue -- Just not sure where to even begin on this, really.

$ /usr/bin/php --version
PHP 7.4.30 (cli) (built: Jun  7 2022 15:50:00) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with the ionCube PHP Loader + ionCube24 v11.0.1, Copyright (c) 2002-2022, by ionCube Ltd.
-bash-4.2$ ls /usr/bin/php*
/usr/bin/php  /usr/bin/php-cgi  /usr/bin/phpize

Any suggestions would be very welcome!

Dave aka Ghan

vbgamer45

The PHP version was increased which knocked the forum offline. Needs to be upgraded. I think you have to SMF 2.0.x then upgrade to SMF 2.1.x
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

ghaniba

aha!  Also found this:
* Software Version:           SMF 1.1.21                                          *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
* Support, News, Updates at:  http://www.simplemachines.org       

Upgrading to 2.0.x then 2.1.x, can I do this all from ssh?  $ php upgrade.php it looks like?  Guess I'll read into that and see where it takes me!

Dave aka Ghan

Dzonny

Hello there and welcome to SMF community!

Yes, the PHP version is too high for such an old SMF version. You must switch to older php in order to have SMF working, and then upgrade it to newer branch.

If you have FTP access that would be great. I'm not sure as I never used ssh to upgrade, but I don't think it's possible.

ghaniba

Quote from: Dzonny on August 29, 2022, 08:41:13 AMHello there and welcome to SMF community!

Yes, the PHP version is too high for such an old SMF version. You must switch to older php in order to have SMF working, and then upgrade it to newer branch.

If you have FTP access that would be great. I'm not sure as I never used ssh to upgrade, but I don't think it's possible.

I'm pretty sure it can be done from ssh, according to the upgrade page:

Upgrading Using the Command Line
It is also possible to upgrade to a more recent version of SMF using the Command Line Interface (CLI). This is particular useful if you have experienced errors trying to upgrade your forum using the method outlines above, as the CLI is more effective in providing an error code, which is helpful in identifying any issues that are preventing the upgrade from being completed.

To upgrade using this method, go to a command line prompt, navigate to the folder where your settings.php and upgrade.php files are, and issue the following command:
php upgrade.php

There are some options, which you can query using --help. You will see something like this:
$ php upgrade.php --help
SMF Command-line Upgrader
Usage: /path/to/php -f upgrade.php -- [OPTION]...

       --language=LANG         Reset the forum's language to LANG.
       --no-maintenance        Don't put the forum into maintenance mode.
       --debug                 Output debugging information.
       --backup                Create backups of tables with "backup_" prefix.

Note that sometimes your host offers multiple versions of php, so you need to specify the correct version when running the command. You might need to ask your host what the proper path to use is. If this is the case, your command line would end up looking something like this:
/opt/php56/bin/php upgrade.php

Kindred

yes, upgrade can be run on ssh command line.    Most people usually use the web interface for upgrades however, unless your site is on a metered server and/or very large.
Сл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."

ghaniba

aha -- Looks like I can go directly from 1.1.x to 2.1.x:

https://www.simplemachines.org/community/index.php?topic=582201.msg4124003#msg4124003

If you are currently using any older version of SMF (including SMF 1.x, SMF 2.0.x, or one of the SMF 2.1 Betas or RCs), you can upgrade directly to 2.1.2 from whichever version you are currently using by using the "Large Upgrade" package from the Download page. Be aware that using this upgrade method will require you to reinstall any customizations that you have added to your forum, so if you are running SMF 2.1.0 or higher, it is recommended that you apply the successive patches instead of using the Large Upgrade.

ghaniba

Well... maybe not so easy.

Updating Your SMF Installation!
Your MySQL version does not meet the minimum requirements of SMF.

Please ask your host to upgrade.
Click here to try again.

/usr/bin/mysql  Ver 14.14 Distrib 5.7.38, for Linux (x86_64) using  EditLine wrapper

Hmmmm....

vbgamer45

I would try commenting out that check in the code itself in the upgrade.php
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

ghaniba

Good idea on commenting that upgrade check out.  Maybe I'll try that next.  I attempted to fire off a 2.0 branch upgrade before seeing your idea.  Didn't go quite how I'd hoped... 

Database Changes
Executing database changes
Please be patient - this may take some time on large forums. The time elapsed increments from the server to show progress is being made!
Executing upgrade script 1 of 2.
Executing: "Updating and creating indexes..." (1 of 19 - of this script)

!!Error!
Unknown Error!

Doug Heffernan

Quote from: ghaniba on August 29, 2022, 09:11:38 AMaha -- Looks like I can go directly from 1.1.x to 2.1.x:

Yes, that is correct. You can upgrade directly to 2.1.2.


Quote from: ghaniba on August 29, 2022, 09:35:33 AM!!Error!
Unknown Error!

Unfortunately this does not tell us much. Is there anything logged in the server error log pertaining to this?

What is your MySql version btw?

Dzonny

Also are you sure that all your paths and settings on forum are correct?
You may use repair_settings.php in order to check all of that.

ghaniba

Paths & settings are correct.  Verified using that script, thanks!

Dave aka Ghan

ghaniba

So, the hosting provider has asked me what version of php / mysql I would like.  That said, what should I ask them for?  I'm not sure if it makes more sense to have them set it for the latest SMF requirements and try the upgrade?  Or should I do a middle step, or get it running on the old version first, etc.  Seems like a bad idea to get the old version running, just to bring live old vulnerabilities!

Dave aka Ghan

Kindred

If you are going to upgrade, then start with php 5.4 or so. 

Get the forum working

Then upgrade smf to 2.1.2 and upgrade pho to 7.4

If you need an intermediary step, upgrade smf to 2.0.19, then upgrade php.... and then upgrade smf to 2.1.2
Сл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."

ghaniba

How would I know if I need an intermediate step?  The docs don't call it out that a 1.x can't jump to the latest.

Dave aka Ghan

Doug Heffernan

Quote from: ghaniba on September 09, 2022, 11:13:51 AMHow would I know if I need an intermediate step?  The docs don't call it out that a 1.x can't jump to the latest.

Dave aka Ghan

You can upgrade directly to 2.1.2. If you will run into issues, you can upgrade first to 2.0.19 as adviced above and then to 2.1.2.

Kindred

It's a php version thing...

Smf 1.x will not work, at all, with php 7+
Smf 2.1.x will not work with php 5.4-

Smf 2.0.x will work with both older and newer versions of php
Сл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."

Advertisement: