PDA

View Full Version : restoring a php database



presto
5th July 2007, 17:41
anyone know how to restore a forum database from a saved text file?

i basically k:censored:ed up a forum by modding it too much and now it dosn't work (at all), fortunately i made a backup, but can't seem to get the backup working as a forum.
i tried restoring the database in my control panle - but it didn't work.
then uploaded the backup file and deleted the messed up file - but that didn't work.

to be honnest i have no idea what i am doing. my next idea was to delete all forum databases, then re-install a forum from scratch, then somehow replace that new forum with the saved text file, - perhaps by using the 'restore my SQL database' in the CP tools.
it didn't work when i tried to restore a f:censored:ed forum - but would it work if i restored the database to a working forum?

Win2Win
5th July 2007, 19:41
The txt file should be an MySQL file (in text :doh)

Should be a Restore option in the forum admin. Depends on what size it is though, as PHP can time out depending on the setting, so usually best to do it via PHPMyAdmin

presto
5th July 2007, 20:16
the tex file is a MySQL.

i am on myphpadmin at the moment and have uploaded the database from the 'MySQL database backup'

not sure what to do next.
it says:
..................................................................................
No tables found in database.
'Create new table on database bigfooty_smf1data200707041sql'
name [..............] number of fields [.....................]
...................................................................................

bigfooty_smf1data200707041sql - being the backup.
where it says name, do i just enter 'forum'. and fields - do i enter the number of forum sections :doh

Win2Win
5th July 2007, 20:36
When you run the forum install, it will automatically setup the tables for you, then you just import the data. If you have no tables, you have nothing to import thr txt into.

presto
5th July 2007, 20:54
how do i import the backup? - can i do it in 'my php admin'?
so far my CP has this in it 'pics'.

bigfooty_smf1 - being the 'new' forum i just installed.
bigfooty_smf1data200707041sql - being the saved old forum.

presto
5th July 2007, 22:08
i have imported the 'saved data' into the new forum - but i just get an error message.

could this be because the new forum is completely new and not the 'messed up one' that the data was saved from?

presto
5th July 2007, 22:54
just looked at how i saved the backup (pic) - and i don't think i will have saved the table structure (i probably only saved what was ticked already), so will this be why my saved database has no table structure?
if so can i still use the backup on a new forum?

Win2Win
5th July 2007, 23:34
Where is Glos, I'm busy? :)

You already have the table structure, as long as the txt file is sound, all you need do is click IMPORT in PHPmyAdmin, browse to the file, and bung it in.

Win2Win
5th July 2007, 23:35
PS. Where is the server backup, it'll have a copy from 24hrs ago.

presto
5th July 2007, 23:55
Where is Glos, I'm busy? :)

You already have the table structure, as long as the txt file is sound, all you need do is click IMPORT in PHPmyAdmin, browse to the file, and bung it in.

thats what i have been trying to do :splapme
would it still work if i deleted the 'not working' forum and started a fresh - as thats what i have been doing?
the hos't dosn't do backups either :mad:

it's doing my nut in this aswell :headbange - will see if the host 'support team' can get it working.

Win2Win
6th July 2007, 00:00
:doh

I have no idea what you done to break it, and as you have the the TXT file, you may as well dump the tables giving you a blank MySQL database, and then delete all the forum files, and start a fresh install. Then Import the txt.

I've just cracked my cron so bed now.:)

presto
6th July 2007, 00:11
cheers for the help keith, i owe you some rep.
sent a message to the support team - will see what they can do.

cron jobs, apache, joomala, pearl.............. all bloody gibberish to me, why can't they make computers easier. :mad:

Win2Win
6th July 2007, 09:47
Apache is your web server, aka Linux, not windows :yikes:

Cronjobs is just a way of automating an execution, rather than typing an address and filename in a browser and doing it manually to say send emails out, and doing that every hour, you'd put it as a cronjob (online statement), and set the time at every hour, the server will then do it on it's own.

Pearl, php, sardines....all the same :doh

presto
6th July 2007, 16:46
i think it all boils down to not saving the 'table structure' - this wasn't automatically ticked in the backup options 'save all important data' was so i assumed that was all i needed :splapme.

just tried a backup ticking 'table structure' - and it's a piece of cake to restore.

ah well - an important lesson learnt.

Win2Win
6th July 2007, 17:25
Maybe you should plan on backing up every week. I do them every other day, and pay the company to backup as well.