How to restore a saved Database

Started by Paffman, May 25, 2020, 12:11:15 PM

Previous topic - Next topic

Paffman

Sorry Admin, I have posted in the wrong board, I started in the 1.1.x support board  :-[

So I have better start again here.

Long story short, my SMF forum got hacked. I have created a new SMF installation and now wish to restore my saved DB.

The DB I have is either a .sql or a complete_date.sql Which one do I need to upload?

When I get one to upload and then run repair_settings, I need to change the prefix in repair_settings to the prefix of the uploaded DB. How do I find the uploaded DB priefix so that I can change it in the repair_settings?

Also I have been approached via a message from someone offering to fix the issue for a fee, is that wise?

Steve

Sir Osis of Liver

Answered in your original topic.  You shouldn't have to pay anyone to fix this, you're almost there.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Paffman

Quote from: Sir Osis of Liver on May 25, 2020, 12:35:08 PM
Answered in your original topic.  You shouldn't have to pay anyone to fix this, you're almost there.


Sorry posted in the wrong board so thought I'd better start again.

So what DB do I need to upload?
****_***.sql or ****_***-complete_date.sql

And where can I find the old DB prefix to add to the repair_settings file?

Sir Osis of Liver

You need a complete backup of the original database.  Depending how you dumped it, the .sql can have different names.  As neither of those files is zipped, they should be pretty much the same size.  Use the one with most recent date.  Once you've imported the dump, you can view the db with phpmyadmin and you'll see the table prefix.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Paffman

Just been back to the OP in the wrong board.

"Just import the database backup into the new (empty) database you created for the new install, then run repair_settings."

How do I import the saved DB into the empty newly created DB?

Paffman

I have been trying to use this cpanel

Doug Heffernan

Quote from: Paffman on May 25, 2020, 12:11:15 PM

Also I have been approached via a message from someone offering to fix the issue for a fee, is that wise?

Steve

Were you approached, or did you aproach others first? I am asking because in my case, you have approached me first in private asking me to fix this for you. And I told you that if you would like me to get involved in actually restoring the backup, I would charge a fee for my time.

Anyways, you have been told a lot of time by several users as to what to do and looking from your replies to our suggestions, I would say that yes, it is wise to hire someone or find someone who can do it for free, to actually do this for you. Otherwise you are going to go in circles endless asking about stuff that have been answered 100 times.



Sir Osis of Liver

Cpanel restore will not restore a cpanel backup to a database with a different name.  You should be able to import it using phpmyadmin if it's not too big.  How large is the .sql?

If you can't get it, PM me with cpanel access, I'll do it tonight.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Paffman

Sorry didn't mean to upset you doug_ips, I was unsure about letting people into my cpanel  :-[

Anyway, I have managed to import my saved DB into the new SMF DB. I have run repair_setting but am unsure what to do now.

See attached.

Paffman

A lot of backup files in the new DB, changed the prefix for the restored DB and now get this... Do I now need to install the theme?

See attached

Kindred

Shows that you have the right database and prefix now... but the wrong paths.

Eun repair_settings.php again. Correct the URLs and file paths
Сл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: Paffman on May 25, 2020, 03:05:07 PM
Sorry didn't mean to upset you doug_ips, I was unsure about letting people into my cpanel  :-[

You did not upset me. I was simply making a correction of your statement.

Paffman

Quote from: Kindred on May 25, 2020, 03:34:15 PM
Shows that you have the right database and prefix now... but the wrong paths.

Eun repair_settings.php again. Correct the URLs and file paths

Thanks, I have run repair_settings again and taken a look and everything looks OK. The path looks OK and all folders/contents seem to be there.

Paffman

I have corrected the paths and now have the structure/boards up and running, unfortunately no pictures work, but at least the information is there. Many, many thanks for all your help, your patience in helping me, it was a steep learning curve, but in the main it is working. Just got to get the bells and whistles and avatars working.

For future reference, how do I backup the database and pictures, avatars etc? And how do I make SMF secure?

Thank you so much.

Steve

a10

Good job! About backups:

Attachments, avatars, all forum related files > FTP program (if using Filezilla, first set transfer type to binary !!!)
Start with a complete backup of the entire forum directory.
Later (regularly) complement it with newer files (new attachments etc).
IMO, do fresh backup of forum files before forum updates, late night experiments, mod installations.

Database > phpMyAdmin (available through cpanel) > export (see attach.). 1 click.
Do it regularly. One may also export individual tables (for editing and subsequent import).
2.0.19, php 8.0.23, MariaDB 10.5.15. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

Paffman

Lovely, thanks great info, thanks  8)

Kindred

If you are  not getting images, then the directories are wrong
Сл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."

Sir Osis of Liver

Or attachments were backed up as ascii and are corrupt.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Paffman

I think that is the fact that I didn't backup the images. I assume that the images are not saved in the DB backup?

@rjen

Nope , they are in the attachment folder. You need to backup those using FTP: they are not in the database...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Advertisement: