Advertisement:

Author Topic: Help with dB move  (Read 1603 times)

Offline pepf

  • Semi-Newbie
  • *
  • Posts: 49
Re: Help with dB move
« Reply #20 on: October 24, 2019, 02:23:57 AM »
I did uninstall and reinstall SMF, paying special attention to this. It remains the same with the same prefix as the dB.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,458
Re: Help with dB move
« Reply #21 on: October 24, 2019, 05:35:21 PM »
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.

Offline pepf

  • Semi-Newbie
  • *
  • Posts: 49
Re: Help with dB move
« Reply #22 on: October 24, 2019, 10:49:05 PM »
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?

Offline pepf

  • Semi-Newbie
  • *
  • Posts: 49
Re: Help with dB move
« Reply #23 on: October 24, 2019, 10:53:22 PM »
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?

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,458
Re: Help with dB move
« Reply #24 on: October 24, 2019, 11:54:58 PM »
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.

Offline pepf

  • Semi-Newbie
  • *
  • Posts: 49
Re: Help with dB move
« Reply #25 on: October 25, 2019, 01:26:00 AM »
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.

Offline pepf

  • Semi-Newbie
  • *
  • Posts: 49
Re: Help with dB move
« Reply #26 on: October 25, 2019, 02:52:53 AM »
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.
« Last Edit: October 25, 2019, 03:56:26 AM by pepf »

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,561
Re: Help with dB move
« Reply #27 on: October 25, 2019, 04:59:45 AM »
have you run repair_settings.php to correct the paths and URL's after you got the database working?

Offline pepf

  • Semi-Newbie
  • *
  • Posts: 49
Re: Help with dB move
« Reply #28 on: October 26, 2019, 01:38:48 AM »
Yes, it seems back to normal now. Thank you.

Offline pepf

  • Semi-Newbie
  • *
  • Posts: 49
Re: Help with dB move
« Reply #29 on: October 26, 2019, 02:21:12 AM »
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.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,458
Re: Help with dB move
« Reply #30 on: October 27, 2019, 12:10:44 AM »
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.

Offline pepf

  • Semi-Newbie
  • *
  • Posts: 49
Re: Help with dB move
« Reply #31 on: October 27, 2019, 06:55:59 AM »
Thank you, I found them. The intention was to find out which mods I had used and then install them again.

Offline pepf

  • Semi-Newbie
  • *
  • Posts: 49
Re: Help with dB move
« Reply #32 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.

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?

Offline davejo

  • Jr. Member
  • **
  • Posts: 344
    • Dave's Hobby Workshop
Re: Help with dB move
« Reply #33 on: November 03, 2019, 03:35:09 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

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.

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 'Quiz' questions Click here
Quiz Test Site Link

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,607
  • Gender: Male
    • Kindred-999 on GitHub
Re: Help with dB move
« Reply #34 on: November 03, 2019, 05:27:01 PM »
It is much more complicated than that...  there are inter-related tables involved....
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline pepf

  • Semi-Newbie
  • *
  • Posts: 49
Re: Help with dB move
« Reply #35 on: November 03, 2019, 07:53:55 PM »
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?

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,187
  • Gender: Male
    • Macedonian electronics forum
Re: Help with dB move
« Reply #36 on: November 04, 2019, 03:51:33 AM »
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?"..."

Offline pepf

  • Semi-Newbie
  • *
  • Posts: 49
Re: Help with dB move
« Reply #37 on: November 04, 2019, 04:19:11 AM »
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.


Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,458
Re: Help with dB move
« Reply #38 on: November 04, 2019, 11:31:20 AM »
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.