• Welcome to Simple Machines Community Forum. Please login or sign up.
December 05, 2021, 09:05:26 PM

News:

SMF 2.0.18 has been released! Please update. Read more.


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.
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

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.
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

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.
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"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.18, php 7.4.25, MariaDB 10.3.30. 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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"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.
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

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.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Paffman

May 26, 2020, 01:34:14 PM #20 Last Edit: May 26, 2020, 01:49:04 PM by Paffman
Quote from: a10 on May 25, 2020, 05:53:30 PM
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.


Hey,

I understand and have done DB backups via phpMyAdmin. But how do I make a backup of the forum directory? In cpanel I have the option of partial or complete, complete is everything on my server space for moving hosts. The partial is for Home Dir, mySQL DB or email forwarders/filters.

Can I not go to cpanel> file manager and just copy the forum folder?

a10

QuoteBut how do I make a backup of the forum directory?
Can I not go to cpanel> file manager and just copy the forum folder?
Yes. But:
Quote from: a10 on May 25, 2020, 05:53:30 PM
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.

Get started using FTP, very useful 'double' file manager, shows both your computer content & the server content, drag, drop, transfer, delete, rename etc files. Watch transfer queues etc. Configure ftp setup, features and views to suit one's needs.

May look complicated in the beginning, then it quickly becomes THE tool.
https://filezilla-project.org/client_screenshots.php

Your host supplies username & password for ftp.
Personally I never ever opened or visited the host's cp file manager (in 15 years!), ftp is so much better as a tool.
2.0.18, php 7.4.25, MariaDB 10.3.30. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

Sir Osis of Liver

Don't think you can download directories with cpanel file manager, just single files, but you can zip the entire forum or just the /attachments directory and download the zip.  FileZilla is much better and faster for managing files.

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Paffman

I have used FTP.

So if I download a complete server space worth, abt 7GB, I could then pick a folder to upload say, packages if it all goes wrong?

Shame I can't just download the forum folder with out all the other stuff.

Sir Osis of Liver

Well, yes you can, either with filemanager or ftp.
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

a10

^^^ Click on the forum folder, drag it over to your chosen location on pc.
1 second of work from your part, ftp will do the rest.
2.0.18, php 7.4.25, MariaDB 10.3.30. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

Paffman


Advertisement: