Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

Upgrade / Database help please!

Aloittaja moraidh, joulukuu 10, 2010, 03:00:07 IP

« edellinen - seuraava »

moraidh

On changing to a new server for my website, I had to reupload the whole site.  With a new SQL database, I installed the lastest version of SMF, as I was operating 1.1.3 or something before (it would never update).

So, having backed up the forum database from the old forum, I was left wondering how to upload it.

From searching here, I gather I have to use MySQL.

Knowing next to nothing about MySQL, I logged in, and tried to import the database, and got errors when going to the forum address.  I deleted all the SMF files via FTP, reuploaded them, reinstalled SMF, then tried to import the no table variant of the database.

This time, I get all the proper boards and members, but when I go to a topic and click on it, I get:

Database Error
Unknown column 'a.file_hash' in 'field list'
File: /web1/user30812/website/forum/Sources/Display.php
Line: 711

I have used the forum maintenance options, but no luck.  I know I have probably made a hash of it all, but it hardly seems an easy thing to reinstall your boards!

Any help more gratefull appreciated!

Illori

are your files the same version as your database? if they are not you will need to upgrade the database to match the version of the files.

Upgrading SMF

moraidh

#2
The complete backup I had done, was on SMF 1.1.4 or something.

I see what you mean about the upgrade being a good idea, but the problem is that since the hosting upgrade, I had to reupload everything onto a new server, i.e. I got a clean slate, so I used the brand new clean install of the latest SMF and ran install.php (there was no existing SMF to upload an upgrade version and thus no "upgrade.php" to run.

So I'm still stuck!

Illori

if you put up your old database it will not work with the new smf code, download the large upgrade package and upload it, then you can run the upgrade.php script to fix your database.

moraidh

OK, I deleted the complete install version, and uploaded the major upgrade, ran upgrade.php and got this:

Warning: require_once(/web1/user30812/website/forum/Settings.php) [function.require-once]: failed to open stream: No such file or directory in /web1/user30812/website/forum/upgrade.php on line 87

Fatal error: require_once() [function.require]: Failed opening required '/web1/user30812/website/forum/Settings.php' (include_path='.:') in /web1/user30812/website/forum/upgrade.php on line 87:


Line 87: require_once($install_path . '/Settings.php');

Line 87 in this file makes reference to Settings.php, which isn't in the upgrade version of SMF, presumably being present from an upgrade on an earlier version.  So the upgrade version of SMF is maybe not suited for a clean install?

Is there any hope here, or do I have to resign myself to having to start the forum from scratch?

Illori

you should NEVER delete that file, it has the database connection information for your forum to work, try to restore it then upgrade.

moraidh

Yes, what I said originally was - I was allocated a brand new server - i.e. a clean slate with no SMF on it, so all I had was the complete back up from the forum on the old server, so I didn't actually delete it personally.

I will try to add this file from the complete SMF and see if it helps.  If not, what can I do?

Illori

you need a copy of the file that is filled out and has the database connection information in it already.

moraidh

OK, I uploaded it and got this message on running upgrade.php

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /web1/user30812/website/forum/upgrade.php on line 93

Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /web1/user30812/website/forum/upgrade.php on line 93

Illori

is the server for the database correct for the new host?

moraidh

This is line 93:

$db_connection = mysql_connect($db_server, $db_user, $db_passwd) or die(mysql_error($db_connection));

So if I replace these withe username and password it should work?  Or do I have to specifiy what these variables are in another file or at the beginning of Settings.php?

Illori

they should be in settings.php

something like this


########## Database Info ##########
$db_server = 'localhost';
$db_name = 'smf';
$db_user = 'smf';
$db_passwd = 'passwordhere';
$db_prefix = 'smf_';
$db_persist = '0';
$db_error_send = 1;

moraidh

OK I'll look for that.  The previous Settings.php wouldn't have been any good, as all the details are new anyway.  Thanks for your continued help!

moraidh

OK, the upgrade seemes to have worked ok after I added those values to Settings.php and uploaded it (together with Settings.bak)

My forum has appeared, but when I click on a topic I get:

http://127.0.0.1/smf/index.php?board=31.0

Obviously I have ot change 127.0.0.1 to by domain name (or IP address????) somewhere.  Is this in Settings.php too?

moraidh

#14
OK, I located and changed the URL in Settings.php.

My gosh - my forum seems to work!  Can it really be true!!

All the old boards and posts are there, presumably they were still in the db somewhere from by previous abortive restorations?

Small issue: Where would I find old avatars for members?  Are they in the backup somewhere, or do they have to upload them again?

Illori

please run What is repair_settings.php? to verify all paths are set to your new domain. they should be in the avatars folder or separate folder if you changed that setting.

all posts/topics/users/settings should be there from the database restore/upgrade.

moraidh

Things seem to be ok again (apart from what I posted here), so many thanks illori!

JimM

If this is solved, please mark it solved by clicking the Mark Topic Solved link at the bottom left.
Jim "JimM" Moore
Former Support Specialist

Advertisement: