[hacked] Please help me restore my DB

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
FreeFall
Registered User
Posts: 209
Joined: Tue Apr 23, 2002 11:03 am

[hacked] Please help me restore my DB

Post by FreeFall »

Hello,
I Woke up this morning to find that my forum had been hacked. Not only hacked, but someone deleted everything, all users and posts, 270,000+ posts and over 10,000 users.

PHPBB Version:2.0.13
PHP: 4.3.10
MYSQL: 4.0.23

I Have a backup of the forum (although its old :( ) but i am having problems trying to restore, cos of its size. (over 400MB).

I have no experience with SSH but i thought i would try it anyway. So i uploaded my SQL File and used SSH and put in:
mysqldump -u username -p --opt databasename > backupfilename.sql

Pressed return, put in my password and nothing happened. (obviously i changed the 'username' and 'databasename' to my own.)

I dont think i did the SSH properly, if anyone can help me with it, or suggest another way then please help :|
ymmotrojam
Registered User
Posts: 279
Joined: Thu Oct 07, 2004 10:10 pm

Post by ymmotrojam »

Whoa, sorry bout the loss! Anyways, I believe there is something out there that allows one to split a large SQL backup into smaller chunks. Anyone know where that is?
rødøye
Registered User
Posts: 9
Joined: Sat Feb 12, 2005 6:31 pm

Post by rødøye »

You could try this little thing. http://www.phpbbstyles.com/sql.php

It generates a php-file out of SQL. I'm not shure if it works with that big files though... (sorry for my english :? ) You could also split your SGLfile into smaler bits manualy, but you should have damn good time to do so with 400MB!
Jeg kom, jeg så, og jeg gikk igjen (Cæsar)
Norwegian support: phpbb.no
I appologise for my bad English, and hope you understand me!
FreeFall
Registered User
Posts: 209
Joined: Tue Apr 23, 2002 11:03 am

Post by FreeFall »

I Have read that you can split the file, but how many bits would it split into! it would take a very very long time, and i have been reading its not the best way to do it (in terms of it doesnt always work).

---edit---

If i upload a GZIPPED version onto the server, how do i unzip it? Will the command line do that its self? (the one i tried was pure SQL not gzipped)
rødøye
Registered User
Posts: 9
Joined: Sat Feb 12, 2005 6:31 pm

Post by rødøye »

phpMyAdmin can unzip gzip-compressions, yes.

But try the page i showed you above!
Jeg kom, jeg så, og jeg gikk igjen (Cæsar)
Norwegian support: phpbb.no
I appologise for my bad English, and hope you understand me!
FreeFall
Registered User
Posts: 209
Joined: Tue Apr 23, 2002 11:03 am

Post by FreeFall »

yeah, but i wont even be able to see the SQL code..How long do you think it will take to open a 400mb text file!??!

I Think i have it sorted now, i havent done it yet, but i tested a different command and that seemed to work on a different DB. When i re-upload my GZip backup i will try that.
Kamejoko
Registered User
Posts: 6
Joined: Sun May 30, 2004 9:06 pm
Contact:

Post by Kamejoko »

The command should have been
mysql -u username -p databasename < backupfilename.sql
Pandra
Registered User
Posts: 1
Joined: Wed Mar 09, 2005 6:12 pm

Post by Pandra »

If the problem that you have is that you can't restore your BD because it is very big, I advise you to use BigDump, with this script you will be able to raise BD to your server of any size.

You can download at http://www.ozerov.de/bigdump.php
User avatar
Joe User
Registered User
Posts: 71
Joined: Mon Sep 13, 2004 9:56 am
Location: Germany
Name: Markus Kohlmeyer
Contact:

Post by Joe User »

Backup:

Code: Select all

mysqlcheck --analyze --check --auto-repair --extend --optimize --all-databases -uroot -p
mysqldump -uroot -p -a -c -i --allow-keywords --delayed-insert --opt $datebase > /path/to/phpbb.dump.sql
Restore:

Code: Select all

mysql -uroot -p $database < /path/to/phpbb.dump.sql
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
FreeFall
Registered User
Posts: 209
Joined: Tue Apr 23, 2002 11:03 am

Post by FreeFall »

I Have a copy of my DB on another server. If i try to download it with GZIP through PHPMyAdmin the file is always corrupt. The file is 43MB but if i look at it in windows on my local machine it says packed: 43,966,174 but the "size" is only reading 133,147. If i try to extract it on my windows machine i get the corrupt message.
Any ideas why it isnt downloading properly? This is the DB on a different server to the 1 i will be restoring to.
User avatar
Joe User
Registered User
Posts: 71
Joined: Mon Sep 13, 2004 9:56 am
Location: Germany
Name: Markus Kohlmeyer
Contact:

Post by Joe User »

The file is not corrupt, just rename it from file.gz to file.sql ;)
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Locked

Return to “2.0.x Support Forum”