URGENT: Transfer database and forum

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
ana4ever-vids
Registered User
Posts: 87
Joined: Sun May 21, 2006 2:38 pm

URGENT: Transfer database and forum

Post by ana4ever-vids » Wed Oct 18, 2006 8:52 pm

I need to change the host (and the database). So I did the database's backup (with the control panel) and the files backup (via ftp).

What shall I do now??? :)

ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Re: URGENT: Transfer database and forum

Post by ckwalsh » Wed Oct 18, 2006 8:54 pm

ana4ever-vids wrote: I need to change the host (and the database). So I did the database's backup (with the control panel) and the files backup (via ftp).

What shall I do now??? :)


KB: how to transfer your MODded forum to a different host
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.

User avatar
Marshalrusty
Project Manager
Project Manager
Posts: 29253
Joined: Mon Nov 22, 2004 10:45 pm
Location: New York City
Name: Yuriy Rusko
Contact:

Post by Marshalrusty » Wed Oct 18, 2006 8:56 pm

Knowledge Base - Moving a board

That article should tell you everything you need to know. COme back if you have any questions.
Have comments/praise/complaints/suggestions? Please feel free to PM me.

Need private help? Hire me for all your phpBB and web development needs

GreyDogz
Registered User
Posts: 200
Joined: Tue May 16, 2006 11:59 am

Post by GreyDogz » Wed Oct 18, 2006 8:56 pm

Delete the backup you did using the ACP and get one using myphpadmin or some other utilities (bigdump)

Check out this link: http://www.phpbb.com/kb/article.php?article_id=9

You could use this too:
GreyDogz wrote: Use this for the backup:

Code: Select all

<?php
include 'config.php';
include 'opendb.php';

$backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz';
$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";
system($command);

include 'closedb.php';
?> 
Use these as the input files:

Code: Select all

<?php
// This is an example of config.php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'password';
$dbname = 'phpcake';
?> 

Code: Select all

<?php
// This is an example opendb.php
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to mysql');
mysql_select_db($dbname);
?> 

Code: Select all

<?php
// an example of closedb.php
// it does nothing but closing
// a mysql database connection

mysql_close($conn);
?>
Last edited by GreyDogz on Wed Oct 18, 2006 8:58 pm, edited 1 time in total.

ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Post by ckwalsh » Wed Oct 18, 2006 8:58 pm

Wow... We all giver different articles :P

I would suggest the articles Marshalrusty and GreyDogz posted, since they are better written.
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.

Locked

Return to “2.0.x Support Forum”