Moving Wordpress Redux

Note: This post is over a year old. You may want to check later in this blog to see if there is new information.

Well, nothing like a comment on your blog from the creator of Wordpress to make you feel silly… It turns out my work in making it simpler to move Wordpress from server to server was somewhat in vain, considering the ability to override the database settings through wp-config.php is built in to Wordpress 2.2…

In the Codex there’s some new info regarding the wp-config.php file. You can now just add and edit these two lines to override the database settings right from the text file. Not as elegant as my little workup, I say, but definitely effective:

define('WP_SITEURL', 'http://www.sample.com/wordpress');
define('WP_HOME', 'http://www.sample.com/wordpress');

» » » »
  1. jack mothershed 07.02.07 / 9pm

    THIS MAY BE A DUPLICATE - SORRY IF AND ENDIF

    Well, it is interesting this entire subject comes up now!

    Having lived seven months with the monkey on my back saying it can type out, given enough time, the correct set of values that will allow my wordpress blogs to run correctly without getting the fatal “”you don’t know how to connect to the database, do you?”” taunt.

    Today, sorry Anthony Hopkins and Jane Goodall, I killed the monkey. It took longer than the allotted 30 seconds. It turned out to be not a chimp, not a chump, but a fullsized hermaphrodite gogorilla.

    The circle six fix doesn’t work for me.
    The new highly vaunted, yet secret to all those plagued with the dreaded db connect virulence, unless they live on wp.org 24/7, I say the highly vaunted wp-config con fig value assignment capabilty for siteurl does not change my data base. not one byte, not one bit and thus methinks should vaunt itself not, at least not in my diggs for it functioneth not.

    I am guessing because I don’t dare spend another six weeks in the bowels of wp code trying to figure it out plus the required six subsequent weeks of postwp either way high doses of lithium and/or gorilla therapy.

    I am guessing the gateway gauntlet to the delirius joy of functioning wp blogness handles urls differently and staticly and changes things to its own idea of how the cosmos runs rather than considering whether the siteurl is a virtual host where all sites and host have a common IP address and other possibilities such as different hierarchical paths through the server to the site depending on whether the site admin is the host admin or not -shudn’t matter but

    While waiting for some answer to come from suppfora and wp dev to settle out, I searched for other blog/CMS/mag tools. They all had deficiencies that made me really appreciate those moments I enjoyed a working wp blogerel.

    So, I was overjoyed with the circle six article and finding the mentioned fields I had idiotically overlooked before. And for a split second everything indicated the light at the end of the tunnel might not be a wayward and hallucinating 747 aircraft coming at me. The jazz was working wonders on my brain from my now ancient german equipment and tons of vhs PAL tapes of everybody from Bix Beiderbeck to Joshua Redman. Then I changed databases on a rather new blog and whammo, friz, napoleon blownapart!!!!

    I am out in the cold again and cannot get that db and wp code in cahoots and all the wp-config mods in the world are not going to help, I fear. Bad attitude but it is an acquired taste.

    But it is good to know that someone is out there dealing with these things and good to know some of them have a jazz ear - jazz works.

  2. brett 07.02.07 / 10pm

    First question, are you using WP 2.2? If not, then the above fix is useless.

    Second question, what exactly is the error you’re getting? It sounds, if I decipher correctly, like your seeing a database error, which isn’t necessarily a problem with your site url setting. You’re better off double checking your wp-config for the proper database settings.

  3. jack mothershed 07.03.07 / 12pm

    Brett, thanks for kind words and suggestions.

    The error is:

    Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.

    * Are you sure you have the correct username and password?
    * Are you sure that you have typed the correct hostname?
    * Are you sure that the database server is running?

    Not to complain but most of that is obvious since the only two user manageable elements in installation are config and the db. Makes sense. True. 99 percent of the time, WhoPea problems are of my own faulty fingered typing.

    The few support forum comments and replies were primarily exercises in condescension.

    Circle Six’s article on this shined its microphone on what I needed - a real possibility.

    I was from the beginning overjoyed with WP. Not many applications currently, IMHO, have the user in mind and assume their software has no errors. WP wisely says we have a bunch of problems, here they are, why do you not jump in and help fix them. That’s the open source way. As soon as I am smoothly functioning and understand a little more, I intend to pay back big time by helping out.

    I had six or seven great blogs going in Jan. and then started getting the db problem and could not nail it down.

    I was happy as I reentered my “get all the WP blogs going well and wonderfully” stage to harness 2.2.1 because it seems we are past most of the WP problems. Most of the problems now are user problems as is my db problem. I screwed up somewhere - problem one. I cannot find the somewhere - problem two.

    Don’t let anything I have or will say suggest I am not a WP fan. The basic structure and features are well thought out. I have to buckle down, go back in there and find out what DB field makes WP resolve to DBconnect error. I thought for a while the field was in an xmldb somewhere. But if that were so, the circle six db switch protocol would not work since it does not mention any such xml animal.

    Thanks again, sorry for long comment, but if we were all perfectly succinct, we could go back to smoke signals. everymanjack

  4. jack mothershed 07.03.07 / 12pm

    Brett, thanks for kind words and suggestions.

    The error is:

    Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.

    * Are you sure you have the correct username and password?
    * Are you sure that you have typed the correct hostname?
    * Are you sure that the database server is running?

    Not to complain but most of that is obvious since the only two user manageable elements in installation are config and the db. Makes sense. True. 99 percent of the time, WhoPea problems are of my own faulty fingered fontification.

    The few support forum comments and replies were primarily exercises in condescension.

    Circle Six’s article on this shined its microphone on what I needed - a real possibility.

    I was from the beginning overjoyed with WP. Not many applications currently, IMHO, have the user in mind and assume their software has no errors. WP wisely says we have a bunch of problems, here they are, why do you not jump in and help fix them. That’s the open source way. As soon as I am smoothly functioning and understand a little more, I intend to pay back big time by helping out.

    I had six or seven great blogs going in Jan. and then started getting the db problem and could not nail it down.

    I was happy as I reentered my “get all the WP blogs going well and wonderfully” stage to harness 2.2.1 because it seems we are past most of the WP problems. Most of the problems now are user problems as is my db problem. I screwed up somewhere - problem one. I cannot find the somewhere - problem two.

    Don’t let anything I have or will say suggest I am not a WP fan. The basic structure and features are well thought out. I have to buckle down, go back in there and find out what DB field makes WP resolve to DBconnect error. I thought for a while the field was in an xmldb somewhere. But if that were so, the circle six db switch protocol would not work since it does not mention any such xml animal.

    Thanks again, sorry for long comment, but if we were all perfectly succinct, we could go back to smoke signals. everymanjack

  5. brett 07.03.07 / 12pm

    Can you connect to the specified database through other means, such as command line mysql or phpMyAdmin? If you want, I’d be happy to take a look at your config if you want to contact me via email… brett [at] circlesixdesign [dot] com. I may see something you haven’t…

Have your say

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>




Safari hates me