News:

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

Main Menu

Help with dB move

Started by pepf, October 23, 2019, 12:38:04 AM

Previous topic - Next topic

pepf

I did uninstall and reinstall SMF, paying special attention to this. It remains the same with the same prefix as the dB.

Sir Osis of Liver

If you reinstall SMF from scratch, the installer will populate a new database with 63 tables with smf_ prefix.  Your database backup will retain the table prefix from the old database.  If they are different, you must either update $db_prefix setting to old prefix, or change the table prefix for all tables to smf_ in phpmyadmin.  Obviously it's easier to just change the setting.  The database name is not usually appended to table names, but if it is, it's part of the prefix and must be included as such in $db_prefix.  The db dump will always import the same way, with the original prefix.  SMF will not recognize the tables if prefix setting is incorrect.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

pepf

Hi, can you see anything wrong with this? It appears to be exactly like your example.

########## Database Info ##########
$db_type = 'mysql';
$db_server = 'localhost';
$db_name = 'easter71_smf650';
$db_user = 'easter71_smf650';
$db_passwd = 'xxxxxxxxx;
$ssi_db_user = '';
$ssi_db_passwd = '';
$db_prefix = 'smf_';
$db_persist = 0;
$db_error_send = 1;

And still it says:  "Table 'easter71_smf650.smf_settings' doesn't exist"

I assume that if the easter71 part is different it doesn't matter? The original database names of the previous host were retained after moving, and it still worked.
After exporting and importing the old part changed to easter71 too. I tried the whole procedure with the importing of the old dB about four or five times, using different versions (backup time), and the 'settings' message appeared each time after using repair_settings.php. BTW, what settings is that about, is it the SMF configuration?

pepf

Do dBases change when SMF is updated? Could it be that something was not properly updated, making it appear it is 2.0.15 while in reality is at an earlier level? Or is it possible that a mod could be causing this?

Sir Osis of Liver

Not on my computer, so this will be quick.  Look at the table prefix in phpmyadmin.  That must be the setting for $db_prefix.  It almost certainly isn't smf_ .  If you can't get it, pm cpanel access (url/user/pw), I'll have a look tomorrow.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

pepf

The table prefix smf_ is  shown when using repair_settings.php, also in the settings.php file. It was the same during at least two test installations.
This is confusing.

pepf

#26
Got it!
Thank you. The concept of what the prefix might be be was all wrong! That did also resolve the error string. Need just to work on the theme and forum should be back up. Thanks again.

Question, which files and/folders should I transfer from the old forum to the new one to retain as much as possible of the original flavor, especially the theme and page settings. Now everything is just lined up on the left without any page structure. I cannot get inside yet, the links do not work for some reason.

Illori

have you run repair_settings.php to correct the paths and URL's after you got the database working?

pepf

Yes, it seems back to normal now. Thank you.

pepf

Actually, I have another question. Moved to a new installation but mods and some other settings are missing. Is there a specific file(s) to move, or is it at least possible to see which mods were installed, originally?

Also, I remember restricting Google spider access to one instance at a time, somewhere, but now do not find where that was.

Sir Osis of Liver

I believe you did a clean install, then imported your production database.  Mods need to be reinstalled, they're not in the clean files.  The database may contain tables and settings created by the mods, so you wouldn't have to reconfigure the reinstalled mods from scratch.  If you have access to the original install, you can look in /Packages to see which mods are there, and in /Packages/backups, which mods were installed when.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

pepf

Thank you, I found them. The intention was to find out which mods I had used and then install them again.

pepf

Succeeded in getting everything to work normally for a few days; but now all images prior to 26th last month have disappeared. There were broken image links showing a 404. Did maintenance and now all  image links are simply not existing anymore.

I will try to install a dB backup, but would it be possible to copy the newer messages, 26th and later somehow into the new dB?

One other question is, are the images stored in the dB or attachment folder? If in the dB, what does the attachment folder do?

Dave J

Quote from: pepf on November 03, 2019, 01:04:13 AM
Succeeded in getting everything to work normally for a few days; but now all images prior to 26th last month have disappeared. There were broken image links showing a 404. Did maintenance and now all  image links are simply not existing anymore.

Short answer to that is yes as far as the database is concerned the images are not where it's been told they are

Quote from: pepf on November 03, 2019, 01:04:13 AM
I will try to install a dB backup, but would it be possible to copy the newer messages, 26th and later somehow into the new dB?

Yes, you need to open your backup database, which has the newer posts in it, copy and paste those into the new database. I use Notepad++ as it does not add any formating to the file.

Quote from: pepf on November 03, 2019, 01:04:13 AM
One other question is, are the images stored in the dB or attachment folder? If in the dB, what does the attachment folder do?

When an image is uploaded to the site it's given a unique code which is then stored in the sites attachments folder (if you look in the attachments folder you will see files that have no apparent filename meaning), the code is also stored in the database so it knows the location of the posts the attachments are linked to.

If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Kindred

It is much more complicated than that...  there are inter-related tables involved....
Сл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."

pepf

What should I copy? The attachment tables? I cannot identify which are from when.

I now have a test install, new SMF installation, copied over old dB backup and old attachment folder from two weeks ago. Would like to add the posts of the last two weeks, but do not know how to do it.

Looking at the newer dB in PhpMyadmin I cannot identify those made in the last two weeks as there are no dates. Is there a simple way to copy them manually? One by one would be fine too.

One important question. Is it worthwhile doing this at all or does this create more complications? Would you advise to just omit this step and go on without those posts?

GigaWatt

Yes, there is a way, but it's really tedious. How many attachments are supposed to be "copied" (it won't be a simple copy/paste) to the other (new ???, I didn't read the whole thread) database?
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

pepf

Thanks a lot for your support and information. It helped me to make a decision.

I decided not to try to recover those posts. They are not worth the trouble. The test forum displays the images now and I will just change the link over to it, leaving those away.

Thank you all.


Sir Osis of Liver

FYI, in smf_messages poster_time is timestamp for the post.  It's unix time, there are many converters online that will give you date/time.  But no, not a good idea to try recovering the posts from one db to another.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: