• Resolved Kruble

    (@kruble)


    I just manually migrated (copied) all my finished wp site files from a sub directory to the root directory. I also changed the wp-config.php file (as per support instructions) to read:

    define(‘WP_HOME’,’http://kevinruble.com’);
    define(‘WP_SITEURL’,’http://kevinruble.com’);

    Now when I try to open my site through the url, I get
    “Error establishing a database connection”.

    There is obviously some code missing to let the database connect, but I have no idea where to look or what to change.

    Any help appreciated!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator James Huff

    (@macmanx)

    First of all, remove those defines. They’re for temporary emergency use only.

    Fix the siteurl and home values directly in that database: https://codex.ww.wp.xz.cn/Changing_The_Site_URL#Changing_the_URL_directly_in_the_database

    You’ll find phpMyAdmin in your hosting account’s control panel.

    Next, check your wp-config.php file and make sure that your database username, password, and host are correct for your current hosting environment.

    Thread Starter Kruble

    (@kruble)

    James Huff: Thanks for the feedback. I carefully did as you suggested, changing the database values and removing the defines. Also all data in wp-config is correct.

    Still getting that database error message. The sub-directory url is still functioning correctly as a site.

    I might mention one thing I’ve done differently is leave the bulk of the wp site in the sub-directory and only copied the .htaccess and index.php files into the root directory, (as per codex instructions) so I’m trying to actually trying to get the site url to point to the subdirectory (or home) url.

    Any thoughts appreciated.

    Moderator James Huff

    (@macmanx)

    Not being able to access the MySQL database isn’t really related to where the files are.

    If you are sure that the connection details in wp-config.php are correct, contact your hosting provider to ask why your database is offline.

    Thread Starter Kruble

    (@kruble)

    OK, thanks…I’ll try that.

    Moderator James Huff

    (@macmanx)

    You’re welcome!

    Thread Starter Kruble

    (@kruble)

    I called Godaddy…they were very helpful…seems I had errantly changed the site configuration to multisite which was conflicting things.

    Thanks again for your response. Marked as resolved

    Moderator James Huff

    (@macmanx)

    Thanks for letting us know what it was!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘database error on migration’ is closed to new replies.