Database Change!

Started by Nameless?, May 21, 2010, 02:06:08 PM

Previous topic - Next topic

Nameless?

Hi, i have just changed webhost, and am wondering how i can configure the new database host settings for smf.
Anyone knows?

live627

The easiest way I know is to simply download and run the full install package. Also see: Installing SMF

This is assuming you have no existing forum.

Nameless?

umm, i have an forum thats why i asked how to change the settings for the database.


live627

This topic should help you get up to speed: What is repair_settings.php?

Did you copy everything from the old site to the new site? How do I move my SMF forum to a different host?

CapadY

database settings can be changed in Settings.php in the root of your forum.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

live627

repair_settings.php will work better because no manual code changes are involved

Nameless?

« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »

PHP error debug
  Error:    file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/vol7/site.com/htdocs/forums) is not within the allowed path(s): (/php_sessions:/tmp:/var/www/errors:/usr/share/php:/home/vol7/xxxx.com/xxxxx56677/site.com/htdocs)   
  Error type/ Nr.:    Warning - 2   
  File:    /home/vol7/xxxx.com/xxxxx56677/site.com/htdocs/forums/Settings.php   
  Line:    62   
  Line 62 source:    if (!file_exists($boarddir) && file_exists(dirname(__FILE__) . '/agreement.txt'))    

Parser timing
  MySQL:    0.0041 s   (2 Requests)
  PHP:    0.0307 s   
  Total:    0.0347 s

I get this now when i changed host... :(

Allusion

Quote from: Nameless? on May 21, 2010, 02:44:54 PM
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:

It looks like a MODx issue, not an SMF issue.

Nameless?

Im afraid The error is being Encountered BY SMF

Allusion

Did you run repair_settings.php? I think it doesn't work 100% for SMF 2.0, but it should do a good enough job. Just click on the recommended paths and URLs and save.

Quote from: live627 on May 21, 2010, 02:27:59 PM
This topic should help you get up to speed: What is repair_settings.php?

Nameless?

No but i changed all the settings manually.

Allusion

Quote from: Nameless? on May 21, 2010, 02:44:54 PM
PHP error debug
  Error:    file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/vol7/site.com/htdocs/forums) is not within the allowed path(s): (/php_sessions:/tmp:/var/www/errors:/usr/share/php:/home/vol7/xxxx.com/xxxxx56677/site.com/htdocs)   
  Error type/ Nr.:    Warning - 2   
  File:    /home/vol7/xxxx.com/xxxxx56677/site.com/htdocs/forums/Settings.php   
  Line:    62   
  Line 62 source:    if (!file_exists($boarddir) && file_exists(dirname(__FILE__) . '/agreement.txt'))    

It seems like some SMF path settings are still not correct. $boarddir seems to point to /home/vol7/site.com/htdocs/forums but the correct path should be /home/vol7/xxxx.com/xxxxx56677/site.com/htdocs/forums (see the difference?)

Running repair_settings.php and using the recommended settings in the Paths and URLs section should fix $boarddir and other settings for you.

flapjack

Quote$boarddir and other settings for you.
keep in mind, yyou will have to manually correct themes folders, same for attachments/avatars/smileys

Allusion

Quote from: flapjack on May 23, 2010, 11:05:51 AM
Quote$boarddir and other settings for you.
keep in mind, yyou will have to manually correct themes folders, same for attachments/avatars/smileys

So repair_settings.php doesn't fix those paths correctly (or at all) for SMF 2.0? Does it at least fix $boarddir (since this seems to be the setting that causes the error here)?

teh_Krall

What exactly are the public html files?

Are the all the files located in the directory where your forum is or are they the actual files name *.html?

For instance in my forum folder I have files like settings.php, SSI.php, index.php, are those what I need to copy? And in order to use the repair tool do you copy those files to the new host in a specific directory or overwrite them to whatever is in the forum dir?

flapjack

Quote from: Allusion on May 23, 2010, 11:10:41 AM
Quote from: flapjack on May 23, 2010, 11:05:51 AM
Quote$boarddir and other settings for you.
keep in mind, yyou will have to manually correct themes folders, same for attachments/avatars/smileys
nope, it only fixes forum url. you can install themes even on a different domain



So repair_settings.php doesn't fix those paths correctly (or at all) for SMF 2.0? Does it at least fix $boarddir (since this seems to be the setting that causes the error here)?
Quote from: teh_Krall on May 25, 2010, 02:03:43 PM
What exactly are the public html files?

Are the all the files located in the directory where your forum is or are they the actual files name *.html?

For instance in my forum folder I have files like settings.php, SSI.php, index.php, are those what I need to copy? And in order to use the repair tool do you copy those files to the new host in a specific directory or overwrite them to whatever is in the forum dir?
you need to copy whole content of your forum root, all the files and folders, to the new location. then run repair_settings.php or fix those manually by editing settings.php

teh_Krall

So essentially you're just copying your old forums (or SMF install) to a new host and fixing the settings that points to the database.

The previous admin we had made a big production out of this and ended up killing the forums. It sounds a lot simpler then he made it out to be :)

I'm going to go give it a practice run, thanks for the help flapjack ;)

flapjack

one thing: if you don't have any database whasoever, then you will need to add another step before you start:
- perform a clean installation of SMF (make sure it's the same version as the old one), in order for the database to be created (if you can get a clean database somehow and install it using phpMyAdmin then you can do that instead)

then just follow previously outlined steps, overwriting files with your previous installation

if you're stuck, send me a pm and I can give you a hand

teh_Krall

Quote from: flapjack on May 25, 2010, 03:05:02 PM
one thing: if you don't have any database whasoever, then you will need to add another step before you start:
- perform a clean installation of SMF (make sure it's the same version as the old one), in order for the database to be created (if you can get a clean database somehow and install it using phpMyAdmin then you can do that instead)

then just follow previously outlined steps, overwriting files with your previous installation

if you're stuck, send me a pm and I can give you a hand

We have a database with a SMF 2.0 RC3 forum running. The problem is that our installed php is version 4.x and we need 5.x to run some of the mods for SMF. So our host said in order to do that we need to move our site to a new server.

So just to test we have a beta server running a clean install of SMF 2.0 RC3. I'm doing a full file copy of our forums and sub folders now and will try making it as you outlined in the previous post using repair_settings.php.


teh_Krall

Thanks again flapjack, everything went nice and smooth on a trial run.

Since I copied our current forum to the same server with a different IP address I was wondering if it's safe to use the copied forum? I'm wondering that because the original forum and copied forum are now using the same database name.

If I renamed the copied forum's database name I'm assuming I will loose all data, is that correct?

Coburn64

You can always do a full database backup using phpMyAdmin, access new host phpMyAdmin, create database, import it from SQL backup and bang, there's your forum. Just set a few paths in Settings.php and presto! Job done.

flapjack

Quote from: teh_Krall on May 26, 2010, 12:12:18 AM
Thanks again flapjack, everything went nice and smooth on a trial run.

Since I copied our current forum to the same server with a different IP address I was wondering if it's safe to use the copied forum? I'm wondering that because the original forum and copied forum are now using the same database name.

If I renamed the copied forum's database name I'm assuming I will loose all data, is that correct?
hold on - so youre saying there's jus one database and two separate forums on the same hosting that are using it? that's wrong, very wrong! one db - one forum (there's certain exceptions from it, I will wait for your feedback)

teh_Krall

Quote from: flapjack on May 26, 2010, 08:52:23 AM
Quote from: teh_Krall on May 26, 2010, 12:12:18 AM
Thanks again flapjack, everything went nice and smooth on a trial run.

Since I copied our current forum to the same server with a different IP address I was wondering if it's safe to use the copied forum? I'm wondering that because the original forum and copied forum are now using the same database name.

If I renamed the copied forum's database name I'm assuming I will loose all data, is that correct?
hold on - so youre saying there's jus one database and two separate forums on the same hosting that are using it? that's wrong, very wrong! one db - one forum (there's certain exceptions from it, I will wait for your feedback)

:)

Yes...

I didn't really think about the problems it could cause till I copied the original forums to the same host with a different url and realized hey we have two forums with the same database name. I figured the repair tool could fix that issue... Mind you I was just checking to see how the process worked until we physically move to a new host on a different server. So now I have two forums with the same database name.

The second forum (copied) one doesn't get used, but I can still still the issue of the database being written to from two forum sources and that's why I was wondering if I could rename the database for the copied one.

I'll just delete the second (copied) forum, but it would be nice to have a secondary forum with actual data on it for testing. 

Advertisement: