Page 1 of 2

Please - Restore problems

Posted: Tue Aug 22, 2006 8:09 pm
by gordonmarkus
Hi,

I'm hoping that someone here can help me out, as I am having a nightmare restoring my forum from a backup.

The restore tool in the admin panel fails, advising that 'no file was uploaded'.

Further to another post, I have tried using the 'bigdump' script, but this fails to connect to the database, even though it is running and the config is correctly setup.

I have also tried using phpMyAdmin, which is a fantastic tool but the web server upload feature within the sql controls for the database also fail to work. I can browse to the file to upload, and I can see the database is running, but when I click to upload the file nothing happens.

Thanks in advice for your help - you might just save my sanity and my relationship!!



Cheers,

-Gordon

Posted: Tue Aug 22, 2006 8:21 pm
by GreyDogz
Is your DB.sql very large? (>2Mbytes)

How did you do your backup hopefully not with the ACP. If you still have access to the old DB do a backup with phpmyadmin following these instructions. http://www.phpbb.com/kb/article.php?article_id=59

Then try to import it again usijg this new file.

Posted: Tue Aug 22, 2006 8:24 pm
by gordonmarkus
Hi,

My database is about 5Mb, and I did obtain it via the admin control panel. Unfortunately the old database is long gone, and I only have the .sql file now.

Any ideas appreciated!

Thanks,

-Gordon.

Posted: Tue Aug 22, 2006 8:52 pm
by morestuff
ok, big dump does work. it only works for mysql databases. the same is for phpmyadmin.

if yours is a msssql or a access database, then none of the normal phpbb tools will work.

assuming you have a mysql database.

bigdump will work if you give it the correct info and install upload and run it properly.
big dump is very easy to use.
get it here:

Big Dump

1. copy your current config.php to your computer

2. open the bigdump.php file in a text editor ( wordpad is fine )

3. where it asks for the database info, put in what is in your config.php file
bigdump.php:

Code: Select all


// Database configuration

$db_server   = "your info here";
$db_name     = "your info here";
$db_username = "your info here";
$db_password = "your info here";
now, in the bigdump.php file, find this:

Code: Select all

$delaypersession = 0; 
change the 0 to 300 and save the file.

4. using ftp, go to your server and create a folder in your phpbb folder, name it dump

5. upload your backup sql file and the bigdump.php file to that "dump" folder

6. in your browser, go to; yourdomain.com/yourphpbb/dump/bigdump.php

you should see the name of your backup file and a link to start the restore,

click on that and wait. It will take some time for large files, but as long as you get no errors and it does not stop, then wait until you get a success message and you are done.

7. when you have a successful restore, be sure to delete or rename the dump folder as it is a security issue if you don't.

that's it.

Posted: Tue Aug 22, 2006 9:12 pm
by gordonmarkus
Hi,

I do have a mysql database, so this shouldn't be a problem.

However, big dump fails to see the database so I can't get the upload link in my browser. The database is definately running because I can run the forum as it is, and phpMyAdmin can see the server running, it's just bigdump can't.

Any other ideas appreciated.

Thanks,

-Gordon.

Posted: Tue Aug 22, 2006 9:33 pm
by Jim_UK
Split the sql file into smaller pieces using this
File splitter by StefanL http://www.algonet.se/~iiab/filsplit.zip

Now go to your database with phpmyadmin and click the import tab.
Import each of the split sql files in numerical order.

Make the splits about 800KB

Jim

Posted: Tue Aug 22, 2006 9:54 pm
by GreyDogz
Is the phpmyadmin a copy you uploaded or one that is connected to a CP? If its via a CP you may not have all correct server info. (i.e. port number or servername if its not the local server. a lot are on different servers than the webserver itself)

If you have access to a phpmyadmin and the DB is smaller than 2MB you should be able to use it to restore. If the backup is larger than 2MB you may have to break it into smaller (<2MB) pieces. Open it up in notepad or wordpad and just break it after a semicolon and save each piece with a unique name (i.e. phpbb1.sql, phpbb2.sql ...) then import each file in order.

Posted: Tue Aug 22, 2006 10:43 pm
by Jim_UK
GreyDogz wrote: If the backup is larger than 2MB you may have to break it into smaller (<2MB) pieces. Open it up in notepad or wordpad and just break it after a semicolon and save each piece with a unique name (i.e. phpbb1.sql, phpbb2.sql ...) then import each file in order.


I pointed him to a tool to split the file quite a while ago.

Jim

Posted: Wed Aug 23, 2006 8:48 am
by gordonmarkus
Hi everyone,

I think that I am now making progress thanks to your advice, but things are still not quite right.

I managed to import all of my file segments, but the forum still does not work.

There was an error when I imported one of the files, as there were duplications in one of the search tables (the word search table) - in order to get around this, I deleted all the entries from this table in a text editor, once complete this table imported ok. However, when all the files were imported, I only had 29 tables in the database rather than 30.

I think that tonight I will delete the database, re-install the forum again (well just copy the phpbb dir back over with the install dirs) and run the install.php again so that my forum table is re-populated with 30 new tables. Then I will re-import the file segments again, but with word search table empty. Does anyone think that this will work, or is there anything else that I need to try?

Something that I noted last night when trying to import the file segments, was that running them in as a text file worked better than using the webserver upload tool. When using the webserver upload, sometimes the screen would just go blank, and I would not get any confirmation that anything was happening.

Thanks again for your help people. I really appreciate it. If you happen to be in the Bristol area, I'll get you a beer!!

-Gordon.

Posted: Wed Aug 23, 2006 9:03 am
by Jim_UK
Hi
There is often a problem with the backups in relation to the Search tables.

There are 3 search tables.
You can remove the INSERT INTO lines from the sql file for those 3 tables and then use the rebuild search tables mod when you have restored the database and got your board working.
http://www.phpbb.com/phpBB/viewtopic.php?t=329629

Jim

Posted: Wed Aug 23, 2006 10:42 am
by gordonmarkus
Hi,

Thanks again for the advice, I'll remove all the INSERT INTO lines frm the search tables and give it another go tonight.

Something that is of a bit of a concern, is that when the split tool completes it's job it states that there are only 29 tables - yet there are 30 when the forum is installed. Is this ok?

Thanks again.

-Gordon

Posted: Wed Aug 23, 2006 5:29 pm
by Jim_UK
No this is not ok.
Open the sql file in a text editor and check the number of tables that are in there.
If there is a missing table you need to know what it is so that you can hopefully replace it.

Jim

Posted: Wed Aug 23, 2006 10:43 pm
by gordonmarkus
Hi,

I have been through my backup sql files and they do not contain any data for the session_keys table. I've been though several of my backups, dating back since the forum was just setup, and none of them contain data for this table.

I have restored all the other tables (by chopping up the backup file with the utility you recommended) but the forum does not run correctly, and give the following error:

phpBB : Critical Error

Error creating new session

DEBUG MODE

SQL Error : 1054 Unknown column 'session_admin' in 'field list'

INSERT INTO phpbb_sessions (session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in, session_admin) VALUES ('039add35045ada91e61b72cd163b911e', -1, 1156372717, 1156372717, '522e5d2c', -1, 0, 0)

Line : 187
File : sessions.php

Having done some basic investigation (I am no software expert as you can probably tell!) it seems as though the sessions.php file is trying to write some data to the field 'session_admin' within the table phpbb_sessions, however when I look at this table, this field does not exist.


As always, your advice is appreciated.

Regards,

-Gordon.

Posted: Thu Aug 24, 2006 1:43 am
by morestuff
don't worry about the session data, the important thing is the table is there.

the data will be added as you and your members log on and off.

for the error, it just means that you have an old database and new files.

you need to upload the install folder that came with your update zip file, then, in your browser, go to:
yourdomain.com/yourphpbb/install/update_to_latest.php

then delete the install folder
and you are done.

Posted: Thu Aug 24, 2006 10:09 am
by gordonmarkus
Hi,

I've only just checked back here, as I finally managed to get the forum working last night.

I ended up having to add an extra field in the sessions table for the 'session_admin', and then I had to put a couple more fields in the users table as there were a couple more sql errors thrown up when trying to login.

If only I'd known about the 'update to latest' thing beforehand it might have been less of a headache!

Well, its all sorted now - thanks everyone for your help.

-Gordon.