Topic: how to get imported punbb database connected/seen by new host/server

I've successfully imported my database onto new server but don't know how to get the database connected and seen as a webaddress. Any help greatly appreciated.

For instance, tyring to find out how to connect the database now with new host? My server provides this:

"MySQL Server Database Connection Settings
Description:

   

This example describes using PHP to connect to a MySQL Database on a Linux hosting account.
<?php
//Connect To Database
$hostname="your_host_name_address";
$username="your_username";
$password="your_password";
$dbname="you_database_name";
$usertable="your_tablename";
$yourfield = "your_field";

mysql_connect($hostname,$username, $password) OR DIE ("Unable to connect to database! Please try again later.");
mysql_select_db($dbname);

$query = "SELECT * FROM $usertable";
$result = mysql_query($query);
if($result) {
    while($row = mysql_fetch_array($result)){
        $name = $row["$yourfield"];
        echo "Name: ".$name;
    }
}
?>

----------------

I can figure out most info to add in, but what would "your_tablename"  and "your_field" be?

Re: how to get imported punbb database connected/seen by new host/server

You wouldn't use that script, you would edit PunBB's config.php

3 (edited by willray 2007-02-02 01:09)

Re: how to get imported punbb database connected/seen by new host/server

I've edited config.php to connect to new server and uploaded it...but when I type in the address as

www.webaddress.com/hk/forum/config.php

nothing happens. This should load the config file and direct the database shouldn't it?
What am I doing wrong here?

THANKS.

Re: how to get imported punbb database connected/seen by new host/server

what should the db_prefix be? mine is blank presently.

Re: how to get imported punbb database connected/seen by new host/server

config.php is not meant to be loaded directly, it's simply a configuration file you need to edit.
The db_prefix depends on what your table names are. If you specified a prefix at the install, then you need to put it in there. If not, blank is OK

Re: how to get imported punbb database connected/seen by new host/server

Smartys wrote:

config.php is not meant to be loaded directly, it's simply a configuration file you need to edit.
The db_prefix depends on what your table names are. If you specified a prefix at the install, then you need to put it in there. If not, blank is OK

ok -- so, i should upload most recentt backup of the punbb forum from old server onto new server via FTP?

THEN, this backup I've FTP'ed will "correlate" with the recent mysql database dump i've successfully imported and the forum should be accessible as it was on old server?

(hoping yes)

Re: how to get imported punbb database connected/seen by new host/server

Learning curve question(s):

What connects the imported database with the actual web address, or, what allows the imported database to be seen on the internet?

The data has been imported successfully already, the various tables and fields are visible through myphpadmin. My host/server tells me i need proper php connection strings.  What gives?

Re: how to get imported punbb database connected/seen by new host/server

ok -- so, i should upload most recentt backup of the punbb forum from old server onto new server via FTP?

THEN, this backup I've FTP'ed will "correlate" with the recent mysql database dump i've successfully imported and the forum should be accessible as it was on old server?

(hoping yes)

If I'm understanding you right, yes

What connects the imported database with the actual web address, or, what allows the imported database to be seen on the internet?

The database isn't seen on the internet. The PHP files need to interact with the database. To do that, they need to connect to the database server. To do THAT, they need connection information (the db host, username, password, etc). For PunBB, that information is stored in config.php

Re: how to get imported punbb database connected/seen by new host/server

Smartys wrote:

What connects the imported database with the actual web address, or, what allows the imported database to be seen on the internet?

The database isn't seen on the internet. The PHP files need to interact with the database. To do that, they need to connect to the database server. To do THAT, they need connection information (the db host, username, password, etc). For PunBB, that information is stored in config.php

i'll expand on that a little more... most (90%+) databases are stored on a server which doesnt ALLOW access from the OUTSIDE world to directly, most (again 90%+) servers only allow access to LOCALHOST:3306

~thegleek

Re: how to get imported punbb database connected/seen by new host/server

hot damn again!  The forum is "correlating" and being seen by the database. It's loaded up and functioning. Thought this was sooo esoteric, reallly had no idea this was so simple! : )  VERY COOL.

One small issue needing rectifying though:

When I moved (FTP'ed) forum files from one server to the other the old server blocked me from moving the cache folder stating it could not be "opened because the server says you do not have the required permissions." Same thing happened when I tried to download the files to my own computer.

So, I tried a workaround by creating a new, but empty, cache folder on the new server. Which, worked but.....the forum is not up to date with the latest posts.

How to get all of the posts onto the new server?

Re: how to get imported punbb database connected/seen by new host/server

The cache folder has nothing to do with the latest posts: everything in the cache folder is based on what's in the database. Thus, your database backup didn't have the "latest posts"

Re: how to get imported punbb database connected/seen by new host/server

hmmmm....okay. But, I actually didn't use the database backup (another question for later) because I didn't know how to uncompress tar.gz file.  Instead I just opened up two FTP windows and transferred from old server to new server. This is when the cache folder was blocked, so I naturally thought what was missing was in the cache.

Re: how to get imported punbb database connected/seen by new host/server

How to get most recent posts through FTP method?

Or, should I always try to work from backups?

Re: how to get imported punbb database connected/seen by new host/server

I'm confused: how did you move the database to the new server?

15 (edited by willray 2007-02-03 03:08)

Re: how to get imported punbb database connected/seen by new host/server

Moved the database through phpmyadmin.

Re: how to get imported punbb database connected/seen by new host/server

Moved forum files through FTP.

Then, following your guidance in another post, edited the config.php file for new server.

Re: how to get imported punbb database connected/seen by new host/server

I'm not familiar with how you transfer a database through phpMyAdmin, but I would assume that it transfers all of the data: what you need to do is shut down the forum on the old server, move the database over however you want, and re-enable the forum on the new server