News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Database problems whilst transferring to new host

Started by Leto Atreides II, September 30, 2023, 07:09:35 PM

Previous topic - Next topic

Leto Atreides II

Moving an old forum to a new host, I have run into problems that seem to center around the database.

Forum is SMF 2.0
Database is MySQL
Not sure how to determine my PHP version

I did notice that upon uploading to the new host, the database was automatically renamed from "wp14forum" to "jotunnymir_wp14forum", so I changed that in repair-settings.php. But that does not seem to have resolved the issue, and I'm not sure what to try next.

Website: http://wp14.org/forum/

Kindred

Check with your host over the other settings... username,  connection and port, password
Сл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."

Doug Heffernan

Quote from: Leto Atreides II on September 30, 2023, 07:09:35 PMI did notice that upon uploading to the new host, the database was automatically renamed from "wp14forum" to "jotunnymir_wp14forum", so I changed that in repair-settings.php. But that does not seem to have resolved the issue, and I'm not sure what to try next.

Website: http://wp14.org/forum/

Have you actually restored the database? If you did, does it contain all the tables? I am asking because when I loaded your forum I got the below error message:

Table 'jotunnymir_wp14forum.smf_settings' doesn't exist
Also, what do you mean by "the database was automatically renamed?" The database doesn't rename itself, automatically or otherwise. As mentioned above, make sure that you have entered correctly all the database details of the new host at your Settings.php file. Another thing, make sure to give the dataabse user full permissions to the database that it is assigned to.

Quote from: Leto Atreides II on September 30, 2023, 07:09:35 PMNot sure how to determine my PHP version

Create a file and name it phpinfo.php, open it up with a php editor program and the following code inside:

<?php
phpinfo
();
?>


Save the changes and upload it to the root of your server space and then call it from the browser by visiting the following link:

http://wp14.org/phpinfo.php
Quote from: Leto Atreides II on September 30, 2023, 07:09:35 PMForum is SMF 2.0

That is a very old version that contains several security vulnerabilities, not to mentions the bugs. A word of advice, if I may, it would be best to upgrade your forum to at least the latest version for the 2.0.x series. Then afterwards you can upgrade it to the current latest version, 2.1.4.

Anyways, please let us know if you will have any additional questions.

Kindred

The database did not rename itself...  it got renamed by the new host to match the new host schema.
That makes complete sense...
Сл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."

Leto Atreides II

Quote from: Doug Heffernan on October 01, 2023, 06:06:03 AM
Quote from: Leto Atreides II on September 30, 2023, 07:09:35 PMI did notice that upon uploading to the new host, the database was automatically renamed from "wp14forum" to "jotunnymir_wp14forum", so I changed that in repair-settings.php. But that does not seem to have resolved the issue, and I'm not sure what to try next.

Website: http://wp14.org/forum/

Have you actually restored the database? If you did, does it contain all the tables? I am asking because when I loaded your forum I got the below error message:

Table 'jotunnymir_wp14forum.smf_settings' doesn't exist
I'm not sure how to look at the tables in a database. My forum got hit, apparently by Russian hackers, and the original hosting provider salvaged what he could and sent it to me in a ZIP folder. I'm hoping the database isn't damaged - but it might be.
Quote from: Doug Heffernan on October 01, 2023, 06:06:03 AMAlso, what do you mean by "the database was automatically renamed?" The database doesn't rename itself, automatically or otherwise. As mentioned above, make sure that you have entered correctly all the database details of the new host at your Settings.php file. Another thing, make sure to give the dataabse user full permissions to the database that it is assigned to.
The database was originally called "wp14forum"; after I uploaded it to the new host, I saw that the name had become "jotunnymir_wp14forum".
Quote from: Doug Heffernan on October 01, 2023, 06:06:03 AMCreate a file and name it phpinfo.php, open it up with a php editor program and the following code inside:

<?php
phpinfo
();
?>


Save the changes and upload it to the root of your server space and then call it from the browser by visiting the following link:

http://wp14.org/phpinfo.php
Holy mackerel, that brings up a lot of info!  http://wp14.org/phpinfo.php

Quote from: Doug Heffernan on October 01, 2023, 06:06:03 AM
Quote from: Leto Atreides II on September 30, 2023, 07:09:35 PMForum is SMF 2.0

That is a very old version that contains several security vulnerabilities, not to mentions the bugs. A word of advice, if I may, it would be best to upgrade your forum to at least the latest version for the 2.0.x series. Then afterwards you can upgrade it to the current latest version, 2.1.4.

Anyways, please let us know if you will have any additional questions.
I am indeed planning to upgrade it. I want to stave off hackers as best as I can!

Leto Atreides II

I also got some info from the new host, via service tickets:

QuoteHello,

I am unsure as to where you are seeing this error since only a generic 500 Error is displayed on my end when accessing "wp14.org" since the application does not seem to provide a more detailed error message.

However as indicated by the error message you have received "Table 'jotunnymir_wp14forum.smf_settings' doesn't exist" this would mean that the database connection has been successfully established, since the application is now looking for that particular table in the database.

Please note that this is a custom application for which we are unable to provide debugging or clarification, since it might be expecting an already populated database whereas yours is empty so you can contact a web-developer or the particular application developer regarding the matter.

As for example the "concrete.php" file seems to have another version's details which are not applicable here, however it is clarifying that it should not be directly edited so we are unable to clarify how it must be edited and if leaving it as is will cause issues:
====
<?php

/**
* -----------------------------------------------------------------------------
* Generated 2018-12-04T09:03:34-05:00
*
* DO NOT EDIT THIS FILE DIRECTLY
*
* @item misc.do_page_reindex_check
* @group concrete
* @namespace null
* -----------------------------------------------------------------------------
*/
return [
'version_installed' => '8.2.1',
'version_db_installed' => '20170802000000',
'misc' => [
'latest_version' => '8.4.3',
'do_page_reindex_check' => false,
],
];


Your account is running MySQL Version: 8.0.22 so you can contact a developer regarding advanced debugging on the matter.

Doug Heffernan

Quote from: Leto Atreides II on October 01, 2023, 08:53:03 AMI'm not sure how to look at the tables in a database. My forum got hit, apparently by Russian hackers, and the original hosting provider salvaged what he could and sent it to me in a ZIP folder. I'm hoping the database isn't damaged - but it might be.

Open up the backup sql file and see if it contains all the tables and data. You can get the table names from the install sql file of Smf install package. Have you restored the backup at the new host? If you have, look if the smf_settings is present in the database for starters and let us know.

To be honest, this part: "salvaged what he could" doesn't sound good. Do you have a backup of the database made prior to the attack?

Quote from: Leto Atreides II on October 01, 2023, 08:53:03 AMThe database was originally called "wp14forum"; after I uploaded it to the new host, I saw that the name had become "jotunnymir_wp14forum".

That doesn't mean that the database has been renamed. It's just how your new hosts prefixes the names of the databases on their server. What about this part?

Quote from: Doug Heffernan on October 01, 2023, 06:06:03 AMmake sure that you have entered correctly all the database details of the new host at your Settings.php file. Another thing, make sure to give the dataabse user full permissions to the database that it is assigned to.

Quote from: Leto Atreides II on October 01, 2023, 08:53:03 AMHoly mackerel, that brings up a lot of info!  http://wp14.org/phpinfo.php

It appears that you are using php version 7.4. on the new host. Your current forum version will not work with that php version. You can see the smf 2.0. php compatibility here:

https://wiki.simplemachines.org/smf/SMF2.0:Requirements_and_recommendations

It would be better if you used Smf 2.0.19 instead. AFter the database restore you should run the upgrader as well. After you sort this out, it would be best to upgrade your php version too in addition to the forum.

Please let us know if you will have any additional questions.

Leto Atreides II

Quote from: Doug Heffernan on October 01, 2023, 09:08:41 AMOpen up the backup sql file and see if it contains all the tables and data. You can get the table names from the install sql file of Smf install package. Have you restored the backup at the new host? If you have, look if the smf_settings is present in the database for starters and let us know.

To be honest, this part: "salvaged what he could" doesn't sound good. Do you have a backup of the database made prior to the attack?
No; the salvage is the totality of that site. I've never really been on the ball with maintaining backups.
Quote from: Doug Heffernan on October 01, 2023, 09:08:41 AMWhat about this part?

Quote from: Doug Heffernan on October 01, 2023, 06:06:03 AMmake sure that you have entered correctly all the database details of the new host at your Settings.php file. Another thing, make sure to give the dataabse user full permissions to the database that it is assigned to.
The database details appear to be entered correctly. Now I'll go about figuring out how to access the permissions settings.

Quote from: Doug Heffernan on October 01, 2023, 09:08:41 AMIt appears that you are using php version 7.4. on the new host. Your current forum version will not work with that php version. You can see the smf 2.0. php compatibility here:

https://wiki.simplemachines.org/smf/SMF2.0:Requirements_and_recommendations

It would be better if you used Smf 2.0.19 instead. AFter the database restore you should run the upgrader as well. After you sort this out, it would be best to upgrade your php version too in addition to the forum.
Once the database is restored, will I be able to upgrade the forum even if the forum isn't working due to PHP incompatibility? This is all very new territory for me.

Leto Atreides II

Oh, boy. While stumbling around trying to figure out where to find the permissions setting for the database, I found the "statistics" page:

QuoteDatabases statistics
Database Ascending   Collation   Tables   Rows   Data   Indexes   Total   Overhead   Action
jotunnymir_wp14forum   utf8_unicode_ci   0   0   0   B   0   B   0   B   0   B   Check privileges Check privileges
Total: 1   utf8_unicode_ci   0   0   0   B   0   B   0   B   0   B   

Tables, rows, data - all zero? Does that mean my database is completely wiped? :(

Sir Osis of Liver

Quote from: Doug Heffernan on October 01, 2023, 09:08:41 AMThat doesn't mean that the database has been renamed. It's just how your new hosts prefixes the names of the databases on their server.

The database has been renamed to jotunnymir_wp14forum, some hosts add account name as prefix.  So $db_name must be jotunnymir_wp14forum in Settings.php.  However it does look like the db is empty, forum has to connect to db to get the missing table error. 

You can view the db using phpmyadmin from your host control panel.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kindred

Ic don't know what concrete.php is...  but it's not an smf file.

If you were hacked,  then I'd suggest dumping everything and putting in clean files.
If you have an empty database,  then you may be out of luck unless your old host can provide a better extract
Сл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."

Leto Atreides II

Quote from: Kindred on October 01, 2023, 03:36:41 PMIc don't know what concrete.php is...  but it's not an smf file.

If you were hacked,  then I'd suggest dumping everything and putting in clean files.
If you have an empty database,  then you may be out of luck unless your old host can provide a better extract
Concrete was part of the web-hosting system that held my forum originally. Much like Wix, it was a pain in the butt trying to design webpages because it forces you to use pre-set templates. My new host is much better; I can design pages from scratch there. But the database seemed to be tied to the Concrete element of the old site, so I was trying to import EVERYTHING in an effort to recover the original forum.

If it's as much of a dead loss as it's beginning to look, I'll just have to scrap it and start over anew.

Advertisement: