Connect to new Database

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
kevinp63
Registered User
Posts: 33
Joined: Tue Jan 29, 2008 3:22 pm

Connect to new Database

Post by kevinp63 » Wed Jun 11, 2008 2:37 pm

I have to move my database (only) to a new server.
I am currently using MSSQL and they are replacing that server.

I have tried these steps:
1. Backup database (using SQL backup)
2. Restored it to new server.
3. Gave rights to the same user account as on the old server.
4. Edited config.php to use the new server name.

When I go to the site I get a "General Error".

Can anyone help?
Thanks in advance.

User avatar
*Christian*
I've Been Banned!
Posts: 884
Joined: Sat Nov 03, 2007 1:35 pm
Location: Location, Location.

Re: Connect to new Database

Post by *Christian* » Wed Jun 11, 2008 2:42 pm

You shouldn't need to re-assign permissions, or rename config.php

Tyr again, only thing time download the database from one installation, and upload it directly to the new installation. Just remember to have the default style (of the old installation) installed on the new installatin. :)
Proud owner of Bertie 3.0
:: No support via PM or IM ::

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51719
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Connect to new Database

Post by Brf » Wed Jun 11, 2008 2:44 pm

If I am reading it right, he is only moving the database. Not the forum.
What type of "General Error" are you getting? And what info is in the config.php?

kevinp63
Registered User
Posts: 33
Joined: Tue Jan 29, 2008 3:22 pm

Re: Connect to new Database

Post by kevinp63 » Wed Jun 11, 2008 2:47 pm

Thanks Christian...
But I am only moving the MSSQL database, not the website.
Trying to avoid re-installing the web app.

In the config.php file I only edited the $dbhost (database server name)

kevinp63
Registered User
Posts: 33
Joined: Tue Jan 29, 2008 3:22 pm

Re: Connect to new Database

Post by kevinp63 » Wed Jun 11, 2008 2:48 pm

The error says:
SQL ERROR [ mssql ]

[]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.


is there a way to have itdisplay more info about the error?
Thanks Brf!

kevinp63
Registered User
Posts: 33
Joined: Tue Jan 29, 2008 3:22 pm

Re: Connect to new Database

Post by kevinp63 » Wed Jun 11, 2008 5:53 pm

still testing...

I am not getting any useful error message.
The old server and database is still online, so I can change the $dbhost back and it works fine.

I put together a quick page on another website that connects to the new database and queries using the same connection parameters as is in the config.php file and it works fine.

Is there a way to get a more useful error message?
Do I need to stop and start the website?

Thanks...

kevinp63
Registered User
Posts: 33
Joined: Tue Jan 29, 2008 3:22 pm

Re: Connect to new Database

Post by kevinp63 » Mon Jun 16, 2008 2:37 pm

Am I the only one that has ever moved just the database?? :cry:

I guess I will just re-install the app...

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51719
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Connect to new Database

Post by Brf » Mon Jun 16, 2008 2:58 pm

Brf wrote: what info is in the config.php?

kevinp63
Registered User
Posts: 33
Joined: Tue Jan 29, 2008 3:22 pm

Re: Connect to new Database

Post by kevinp63 » Mon Jun 16, 2008 3:28 pm

Brf wrote: what info is in the config.php?
$dbms = 'mssql';
$dbhost = 'server1.xxxx.com';
$dbport = '';
$dbname = 'PHPBB';
$dbuser = 'username';
$dbpasswd = 'password';

$table_prefix = 'phpbb_';
$acm_type = 'file';
$load_extensions = '';

@define('PHPBB_INSTALLED', true);
// @define('DEBUG', true);
// @define('DEBUG_EXTRA', true);

I am only changing the $dbhost server name.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51719
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Connect to new Database

Post by Brf » Mon Jun 16, 2008 3:33 pm

Yeah. You are not getting a very good error message.
Are you seeing any errors on the SQL server? It might be a permissions issue or something.
You might get a better phpbb error message by turning on those debug lines too.

kevinp63
Registered User
Posts: 33
Joined: Tue Jan 29, 2008 3:22 pm

Re: Connect to new Database

Post by kevinp63 » Mon Jun 16, 2008 3:59 pm

Doh!..
The debug lines were right there in front of me!


Now I have some errors...

FILE: includes/db/mssql.php
LINE: 60
CALL: dbal->sql_error()

FILE: common.php
LINE: 206
CALL: dbal_mssql->sql_connect()

FILE: index.php
LINE: 20
CALL: include('common.php')

checking these out now..
Thanks Brf!

kevinp63
Registered User
Posts: 33
Joined: Tue Jan 29, 2008 3:22 pm

Re: Connect to new Database

Post by kevinp63 » Mon Jun 16, 2008 4:52 pm

hmmm....
Those errors don't make a lot of sense either as they just point back to the connection parameters...

If I change the server name to a bogus server name I get THE SAME error messages..
it's almost as if it can't see the new server. (But I can ping it fine and connect to the DB with a test script)

One bit I forgot to mention..
The new server is SQL2005. Old one is 2000
Same port though.

bah.

User avatar
rhythm1
Registered User
Posts: 950
Joined: Sat May 10, 2008 9:23 pm
Location: Maldives

Re: Connect to new Database

Post by rhythm1 » Mon Jun 16, 2008 4:57 pm

kevinp63 wrote:Same port though.
Just a crazy guess. Did you try with keeping the port blank?
`Rhythm
I 'd rather live in a world with PHPBB
Where we stand and where we siT - Shit is bound to be always therE

kevinp63
Registered User
Posts: 33
Joined: Tue Jan 29, 2008 3:22 pm

Re: Connect to new Database

Post by kevinp63 » Mon Jun 16, 2008 5:03 pm

Yes the port is blank...
I tried putting in the port manually and that didn't change anything either...

I am getting closer to just re-installing

kevinp63
Registered User
Posts: 33
Joined: Tue Jan 29, 2008 3:22 pm

Re: Connect to new Database

Post by kevinp63 » Mon Jun 16, 2008 7:06 pm

well....This is confusing.

On a whim I decided to make a DSN on the webserver to connect to the new database server.
Edited the config.php to use mssql-odbc

$dbms = 'mssql_odbc';
$dbhost = 'PHPBB'; //dsn name
$dbport = '';
$dbname = 'PHPBB';
$dbuser = 'username';
$dbpasswd = '*******';

The DSN works..
But I don't get it.

I triple checked my spelling and what I had in the config.php matches what I put in the DSN, yet only the DSN works..

Locked

Return to “[3.0.x] Support Forum”