1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Transferring site to new domain, DB help...

Discussion in 'Databases' started by Nathan Mclean, Oct 16, 2013.

  1. #1
    Uploaded script to trustdeedweb.com

    As you will see the site was originally built for a different domain but I want to upload and convert it to operate on trustdeedweb.com

    I have successfully uploaded all site files but I am having problems connecting the site to the database as you will see here - http://trustdeedweb.com/blog.php

    I have never done this before but I want to learn how to do it for future as when I asked a programmer I worked with before for a price to do it and he quoted $200 which I thought was insane?

    Can anyone point me in the direction of where I can learn to do this or give me any pointers thanks?
     
    Nathan Mclean, Oct 16, 2013 IP
  2. Nathan Mclean

    Nathan Mclean Member

    Messages:
    86
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    45
    #2
    by 2learn to do this stuff" I mean work with databases and connect them with site scripts etcc :/
     
    Nathan Mclean, Oct 16, 2013 IP
  3. murugan6

    murugan6 Greenhorn

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #3
    Hi home2/trustdee/public_html/include/config.php on line 17 kindly check it and tell me what is their
     
    murugan6, Oct 17, 2013 IP
  4. Nathan Mclean

    Nathan Mclean Member

    Messages:
    86
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    45
    #4
    $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql');
     
    Nathan Mclean, Oct 17, 2013 IP
  5. redlandgames

    redlandgames Active Member

    Messages:
    909
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #5
    Have you put your database details info in config?
     
    redlandgames, Oct 19, 2013 IP
  6. Nathan Mclean

    Nathan Mclean Member

    Messages:
    86
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    45
    #6
    no redlandgames I don't know how, is there any guides you can point me in the direction of? thanks
     
    Nathan Mclean, Oct 19, 2013 IP
  7. Corestratagems

    Corestratagems Active Member

    Messages:
    122
    Likes Received:
    10
    Best Answers:
    1
    Trophy Points:
    63
    #7
    Do you know your database details? You have to edit wp-config.php in a text editor. At the top section you should see the lines that set the database name, user and password. Those have to be correct. Here is more on that http://www.siteground.com/tutorials/wordpress/transfer-wordpress.htm
    If the URL has changed you will need to change that in the Database itself as well. See the bottom of that page for instructions on doing that.
     
    Corestratagems, Oct 21, 2013 IP
  8. Nathan Mclean

    Nathan Mclean Member

    Messages:
    86
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    45
    #8
    thanks guys, I ended up paying a developer to do this... I still want to learn how to do it myself so I'll take note of your comments.
     
    Nathan Mclean, Oct 22, 2013 IP
  9. jscg

    jscg Well-Known Member

    Messages:
    161
    Likes Received:
    5
    Best Answers:
    3
    Trophy Points:
    108
    Digital Goods:
    2
    #9
    Let's assume you are using Wordpress, but method is pretty much same on any platform, just look for config.php or config.inc.php or similar file, sometime its under "include/config.php" or something like that.

    On your new hosting create new database ex: "wp_db", and also new database user ex: "wp_user" (without quotes), assign newly created user to your newly created database.

    After that login to your old database via phpmyadmin or Navicat, export your database and import it on new hosting database you created.

    Now go to your config file and search for something like this (this is from wordpress):

    define('DB_NAME', 'wp_db'); // this is your database
    define('DB_USER', 'wp_user'); // this is your databse user
    define('DB_PASSWORD', 'wp_pass'); // this is your databse user password
    define('DB_HOST', 'localhost'); // this is your databse host, you can leave it localhost

    On some other platforms you should look for:

    $host = "localhost";
    $user = "some_user";
    $pass = "some_pass";
    $db = "db_name";

    Or something like that, you will also need to change your root path on some configurations to your new hosting path.

    It's really easy to move sites from one to another hosting.

    If you have any questions just ask.
     
    jscg, Oct 23, 2013 IP