phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Restoring a database


 
Search this topic... | Search General Support... | Search Box
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Author Message
cobi
Board Member



Joined: 18 Jan 2010

Posts: 7



PostPosted: Mon Jan 18, 2010 11:31 pm 
Post subject: Restoring a database

My old ISP's server kept going down, so I moved my website. Before leaving I made a backup of my board.

I have now installed a forum on another ISP and created the database etc... everything seemed to go fine. I am now trying to restore the old database file to get everything back.

I go into the the admin panel and click restore database, point it at my phpbb_db_backup.sql file. It runs for quite a while and then seems to finish. But, nothing changes. I don't get any kind of error messages. I still just see the test forum and test thread.

Am I missing a step somewhere? My backup looks good, I can open it in wordpad and see that my users/threads are all in there.

I installed version 2.0.23.
Looking at the text file It appears my backup was actually done in 2.0.22
The last line contains "Powered by phpBB 2.0.22"

The version doesn't really matter to me. All I'm trying to accomplish is to get it accessible and then I'm going to cut & paste the threads into a different forum that is already setup. Then this old forum will be deleted. Just don't want to lose some of this history.

Thanks.

FYI, I tried this from another thread (except the last step which I'm not following):

-----------------------------------------
lumpy burgertushie wrote:

here is the proper way to do it:

1. install phpbb on the new host with a new database

2. restore your old database backup to the new one.

3. upload the new install folder again and in your browser, go to:

yourdomiain.com/yourphpbb/install/update_to_latest.php

delete the install folder again and you are done.

you will need to reset the domain name and script and cookie path in the admin panel or use the cookie MOD to do it for you.

????? I found the cookie settings, but have no idea what I should set them to or if this matters in my case.
Back to top
cobi
Board Member



Joined: 18 Jan 2010

Posts: 7



PostPosted: Mon Jan 18, 2010 11:56 pm 
Post subject: Re: Restoring a database

After some further searching it looks like my restore is probably timing out (it's about 25MB).

I'm going to try importing the file via phpmyadmin instead.

Hmmm...... the import window isn't showing me any "progress". I'll let it run and see what happens.
Back to top
cobi
Board Member



Joined: 18 Jan 2010

Posts: 7



PostPosted: Tue Jan 19, 2010 12:33 am 
Post subject: Re: Restoring a database

OK, that worked better. It looks right, the different forums are there, but no posts!

There are no posts in this forum.
Click on the Post New Topic link on this page to post one.

In myphpadmin I can see posts by looking at the sql.
Back to top
cobi
Board Member



Joined: 18 Jan 2010

Posts: 7



PostPosted: Tue Jan 19, 2010 2:26 am 
Post subject: Re: Restoring a database

Number of posts: 191 Posts per day: 0.09
Number of topics: 68 Topics per day: 0.03
Number of users: 1 Users per day: 0.00
Board started: 12 May 2004 12:25 pm Avatar directory size: 4.17 KB
Database size: 927.13 KB Gzip compression: OFF



It seems to see the topics/posts. It just isn't displaying them for some reason. The user count is wrong. Not sure what happened there.
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 414
Location: Québec


flag
PostPosted: Tue Jan 19, 2010 3:06 am 
Post subject: Re: Restoring a database

Restoring a phpBB forum from the interface never worked for me either, so importing the SQL from phpMyAdmin is what I would have recommended you as well. Not sure why the posts don't seem to get through nor why the user count is so messed up.

I know nothing of the differences between 2.0.22 and 2.0.23, but my first advice would be to try importing the SQL on a 2.0.22 to make sure that the structure matches both the code and the data.

If that does not work either and you don't get any advice more useful than this, my next step if I were you would be to cut and paste the posts directly from the SQL backup (or your database since it is now imported, at least, and it would be easier to view the post/user/topic association there). Since your ultimate goal is to simply retrieve the messages, I wouldn't spend too much time getting the forum running.
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Tue Jan 19, 2010 8:13 am 
Post subject: Re: Restoring a database

1) Download mysqldumper and "install" it (easy, fast!) on the old host and on the new host
2) make a backup of the DB with mysqldumper on the old host
3) transfer the backup-file to the new host
4) restore the DB with mysqldumper on the new host
5) copy the forum-files to the new host
6) it might be nessecary to edit the phpBB2 config.php-file (only nessecary if you changed DB-name and DB-user/pw)

Move finished!

After that: update to phpBB 2.0.23.
Back to top
cobi
Board Member



Joined: 18 Jan 2010

Posts: 7



PostPosted: Tue Jan 19, 2010 3:22 pm 
Post subject: Re: Restoring a database

Holger wrote:
1) Download mysqldumper and "install" it (easy, fast!) on the old host and on the new host
2) make a backup of the DB with mysqldumper on the old host
.........


Unfortunately I don't have any access to the old host since I made the DNS changes. I never had full access to it anyway (ability to update & install). The problems began because I couldn't get him to run any updates (I wanted to be able to delete spammer accounts in bulk, not one at a time and couldn't get him to install the tool to do it). Then the server was down frequently, etc... The only way I was able to do the backup was to use the control panel. Even though I was the owner of the domain I was pretty much just a mod. I've unfortunately learned 10 times as much in the last 24 hours about phpbb than I knew the last few years while we ran it!

As for #6, both the DB name and DB-user password were in fact changed. I don't know what he called the DB, I just made something up. Not sure how to edit the config.php file. When I try to pull it up I get a blank screen. Do I need to copy the install folder out there again?

I think the old forum is still alive somewhere. Just not sure how to access it since I changed the DNS.
Back to top
cobi
Board Member



Joined: 18 Jan 2010

Posts: 7



PostPosted: Tue Jan 19, 2010 3:38 pm 
Post subject: Re: Restoring a database

Salvatos wrote:
I know nothing of the differences between 2.0.22 and 2.0.23, but my first advice would be to try importing the SQL on a 2.0.22 to make sure that the structure matches both the code and the data.


I might do a new download and try again. I thought the version I was using before was 2.0.23 but after looking at the backup file it apparently was 2.0.22. I wouldn't think it would be a big issue since people import old data when they do updates right?

Salvatos wrote:
If that does not work either and you don't get any advice more useful than this, my next step if I were you would be to cut and paste the posts directly from the SQL backup (or your database since it is now imported, at least, and it would be easier to view the post/user/topic association there). Since your ultimate goal is to simply retrieve the messages, I wouldn't spend too much time getting the forum running.


It's been a LONG time since I messed much with SQL, would I need to write query to associate the user/topic/posts and pull them in a logical order? If I can tackle this through SQL, it's fine with me. Messing around in myPHPAdmin I can see the posts (see attached jpg).

I piggybacked it on my work webserver to try and get it up and running. If you guys wanna see what it's doing, here's the link:

http://www.elamconstruction.com/phpBB2/index.php

I've got to be fairly close at this point.



myphpadmin.jpg
 Description:
Screenshot of post data
 Filesize:  113.97 KB
 Viewed:  460 Time(s)

myphpadmin.jpg


Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 414
Location: Québec


flag
PostPosted: Tue Jan 19, 2010 5:11 pm 
Post subject: Re: Restoring a database

cobi wrote:
Not sure how to edit the config.php file. When I try to pull it up I get a blank screen. Do I need to copy the install folder out there again?

Does your host use cPanel? You have to access the file via an editor (or edit your local copy on Wordpad for instance and upload it back unto the server) to change its content.

Those are the variables you are most likely to have to change:

Code:
$dbhost = 'localhost';
$dbname = 'name';
$dbuser = 'user';
$dbpasswd = 'pass';

$table_prefix = 'pre_';


Seeing how the index page does manage to count the number of posts per forum, I wouldn't expect the database connection to be the problem, though.


cobi wrote:
I might do a new download and try again. I thought the version I was using before was 2.0.23 but after looking at the backup file it apparently was 2.0.22. I wouldn't think it would be a big issue since people import old data when they do updates right?

Usually, when you perform a phpBB update, you just edit/replace the concerned files and, on occasion, add or modify some database information. There usually is no SQL import per se.

cobi wrote:
It's been a LONG time since I messed much with SQL, would I need to write query to associate the user/topic/posts and pull them in a logical order? If I can tackle this through SQL, it's fine with me.

You could build your own PHP page to fetch and assemble the posts, either one topic at a time or all at once. You could convert the user_id to the actual usernames for each post. Dates and other info could also be retrieved, but that would be more complicated.

At this point, though, you're basically rebuilding a very rough viewtopic.php page, so it would probably take some time to get together. I wouldn't mind creating that for you if you are not familiar with PHP/MySQL, but I unfortunately cannot make that much code for free.

At any rate, I have to go to work so I will be back this afternoon if you need tips or advice. And if per chance you woud like to discuss the possibility of hiring me right away (although I don't expect that you will think it is worth it), feel free to e-mail contact_abn AT hotmail DOT com.
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Tue Jan 19, 2010 5:18 pm 
Post subject: Re: Restoring a database

Can you get into your Admin Panel?

If yes, go to the forum administration and find and click on a link next to each forum that says "Synchronize".

See if that helps, and if it doesn´t helo it won't hurt either.

_________________
phpBB2 will never die, I hope!
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Tue Jan 19, 2010 5:21 pm 
Post subject: Re: Restoring a database

Look!

I got there by clicking on the username, the find all post by link in his profile and selecting the message you see.

_________________
phpBB2 will never die, I hope!
Back to top
cobi
Board Member



Joined: 18 Jan 2010

Posts: 7



PostPosted: Tue Jan 19, 2010 5:23 pm 
Post subject: Re: Restoring a database

Fixed it!

Thanks for the help guys. If nothing else, me taking the time to write it out made me think it out in more detail.

Basically what it boiled down to was some of the tables were created but the actual data never imported. I noticed the following tables had no records or only the default setup records:
phpbb_posts
phpbb_users
phpbb_topics

Strangely enough the phpbb_posts_text imported fine. And I had been looking at those records and seeing my data and thought it was fine.


I started cut & pasting the individual table sql from my backup file into the sql box on myphpadmin and eventually got it all to work. It's been a long time since I took a database class but I guess it hasn't changed enough that I couldn't eventually figure out the problem.
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 414
Location: Québec


flag
PostPosted: Tue Jan 19, 2010 5:50 pm 
Post subject: Re: Restoring a database

That's great. I wanted to mention checking if every table was complete, but I think I skipped that part when I saw your attachment ^^ Glad that you got through it!
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Tue Jan 19, 2010 8:20 pm 
Post subject: Re: Restoring a database

Good, glad to see you managed to figure it out and fix it.
_________________
phpBB2 will never die, I hope!
Back to top
Display posts from previous:   
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0218 seconds using 17 queries. (SQL 0.0090 Parse 0.0026 Other 0.0102)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo