Reconnecting wordpress to a database

A year ago we had a multiuser site that was hosted on a Mac X-server running the old server version that included Apache, php, and mysql. We lost the server hosting location. …

Now we are in the process of setting up a new MacMini at MacMiniVault.

I have Apache running, php running, and mysql running.

I have imported the mysql database into the new MySql

I have the entire web server hierarchy, including the .htaccess and the wp-config.php from the old server in the new server location.

How do I connect the old wordpress installation to the newly imported database.

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hey there, marpie1!

    There are a few steps here.

    1. How I would do this is start by installing a clean copy of WordPress on your server.

    2. Next, I’d import the existing database into the fresh one that was just built when you did a fresh WordPress install.

    3. Next, copy the folders and files to the new installation.

    4. Edit your wp-config.php file to recognize the new database credentials.

    5. Regenerate your salts in wp-config.php. (there are instructions in comments in the file itself.)

    6. If any URLs have changed (and they shouldn’t) you’ll need to do a find/replace in your database to replace old URLs with new URLs.

    That should get you connected and ready to go. Thanks for your question!

  • marpie1
    • Design Lord, Child of Thor

    Do you mean, when you say,

    “2. Next, I’d import the existing database into the fresh one that was just built when you did a fresh WordPress install.”

    Import into MySQL as a new database, alongside, the newly created database, or do you mean exactly, import the old database into the new database? …

    For example;

    if the database inside the old MySQL server was named

    C4HWordpressData – This one was used and has a lot of data.

    And if the newly created database inside the new MySQL server was named

    C4HWordPressPhoenix – This one was used to install and verify the wordpress installation.

    In the new MySql sets of Databases should I have just the new database with all the old stuff overwriting the new stuff?

    C4HWordpressPhoenix

    Or should I have both databases, the new one, now unused, and the old one to be used?

    C4HWordPressPhoenix – Only used to setup and check the installation

    C4HWordpressData – Imported as a complete database from the old server, and pointed to in wp-Config.

  • Anang
    • New Recruit

    Hi Marpie1

    Trying to help here :slight_smile: From your situation here :

    1. You move old files to new server

    2. You move database to new server with the same name

    3. No domain change ?

    If you only want to reconnect database you need to change db information on wp-config.php

    /** The name of the database for WordPress */
    define('DB_NAME', 'wordpress');

    /** MySQL database username */
    define('DB_USER', 'root');

    /** MySQL database password */
    define('DB_PASSWORD', '');

    /** MySQL hostname */
    define('DB_HOST', 'localhost');

    If you want to use your old database (with the same name and old data) you don’t need to edit it. Just edit new server hostname, username and password.

    Let me know if you need anything else :slight_smile:

    Best Regards

  • marpie1
    • Design Lord, Child of Thor

    Thank you. … I think that is perfectly clear.

    I am still dealing with another issue regarding my installation and the WPMU DEV plugin, but I do believe Jack Kitterhing. …

    As soon as that issue is resolved, I will reconnect the imported database (with the old database name) … The domain name is exactly the same. So I think we are good to go.

    Thank you for your help. … As soon as I make the reconnection, or have another problem, I will repost on this thread and let you know how things went.

    Jack

  • marpie1
    • Design Lord, Child of Thor

    I need to clarify a step. …

    You say in step 1 …

    1. You move old files to new server.

    I need a little more clarity. … By “Your old files,” do you mean, the entire document root of the old setup except the two files, the wp-config php, and the .htaccess files?

    Or do you mean, just the entire contents of the “wp-content” folder?

    Or, do you mean something else?

    Jack

  • Anang
    • New Recruit

    Hi Jack

    If it will be the same website with same setting and same domain, you move all “root document” to your new server (including wp-config.php and .htaccess) . You just need to adjust your DNS server to point to your new server :slight_smile:

    Let me know if you need any help :slight_smile:

    Best Regards

  • marpie1
    • Design Lord, Child of Thor

    I did that. …

    I restarted the computer.

    Now when I try to go my web presence, I get a blank page, but no error.

    Also, there are many things in the new wp-config file that is no longer in the document folder.

    The old wp-config file that is now in the root document folder, does not have some of the information that the newest has.

    I did move the newest phpMyAdmin into the new document folder. And I can use it fine.

    Jack

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hi there, Jack!

    There could be a few causes here, but the most likely would be:

    1. Your wp.config.php file could be corrupt. What extra info are you seeing in the new host?

    2. You haven’t changed the DNS settings for your domain to point it to your new host. You may need to log in to the place where you registered your domain and make sure the nameservers and the A/CNAME/MX records are correct for your new host.

    3. When you moved the contents of your root html folder to the new server, you may not have preserved the folder structure, or didn’t overwrite existing files on your new server with the backup files from the old one, so you’ve got duplicates of crucial files or folders.

    Do any of these sound like they might be the cause of what you’re seeing?

    Thanks, Jack!

  • marpie1
    • Design Lord, Child of Thor

    1. I’ll get back to one. …

    2. … community4health.com was working with the newest set up, by changing info at godaddy. It is still pointing to the ip number of the server. … And I can still reach a set of medial files I tested to see if the domain name is working. … This sound bite was directed at me, not at you ‘all. :wink:

    http://community4health.com/Media/SoundBites/RockyAndBullwinkle/mister_know_it_all2.mp3

    3. I deleted the entire set of files and folders in the web server document root, before I moved the old set of files and folders into place. I am on a Macintosh, with full privileges, so I just grabbed the entire set of files and folders, and drug them into place. … So there should be no duplicates. … Might that have caused a permission problem?

    Back to 1. … Would you like me to email you the two files? I am a little leary of posting them through this web interface.

  • Anang
    • New Recruit

    Hi Jack

    Could you turn on wodpress debugging ? It’s on wp-config.php find this line :

    define('WP_DEBUG', false);

    and change “false” to “true” , if you still don’t see any errors, I need your ftp access to check if the files is well structured and no corrupt files :slight_smile:

    Please let me know the result from turning on wordpress debug first :slight_smile:

    Best Regards

  • marpie1
    • Design Lord, Child of Thor

    Well, lookie here. …

    Notice: define() was called with an argument that is deprecated since version 3.0! The constant VHOST is deprecated. Use the boolean constant SUBDOMAIN_INSTALL in wp-config.php to enable a subdomain configuration. Use is_subdomain_install() to check whether a subdomain configuration is enabled. in /Library/WebServer/Documents/wp-includes/functions.php on line 2908

  • Anang
    • New Recruit

    Hi Jack

    It think your wordpress version is too old, so we need to adjust some config . Do you have a multisite installation ?

    So it would be great if I can take a look to your FTP and try find the problem there :slight_smile: You can send me your credential here :

    https://premium.wpmudev.org/contact/

    Subject: “Attn: Anang

    -WordPress admin username

    -WordPress admin password

    -login url

    -FTP credentials (host/username/password)

    -link back to this thread for reference

    -any other relevant urls

    Select “I have a different question” for your topic – this and the subject line ensure that it gets assigned to me :simple_smile:

    Let me know if you have sent me credential :slight_smile:

    Best Regards

  • marpie1
    • Design Lord, Child of Thor

    Partial Wahoo! Ooops!

    I have no idea how I missed that. … Blind I guess. … But, Almost everything seems to be working now. I have upgraded everything to the most recent version of wordpress. EXCEPT!

    The problem now is. … Back when we started this, before we got the old version up and running, the WPMU DEV plugin keeps thinking we are not registered.

    Jack Kitterhing fixed this in the initial install via this thread. so he knows what that problem is.

    https://premium.wpmudev.org/forums/topic/wpmu-dev-plugin-dashboard-says-free-member-but-we-are-paid

    AND I NOTICED that while the blogs came along. … Our WIKI’s are no longer here. They did not make the transfer.

  • Anang
    • New Recruit

    Hi Jack

    I can’t login with your username/pass could you check it again and resend the username/password ? I see on your plugins folder that wiki folder is exist so maybe the tables not imported ?

    I see your thread here https://premium.wpmudev.org/forums/topic/wpmu-dev-plugin-dashboard-says-free-member-but-we-are-paid is resolved. Do you got the answer by email from Jack Kitthering ? Could you share the answer to me so I don’t need to re-investigate the case from start again ?

    Let me know more :slight_smile:

    Best Regards

  • marpie1
    • Design Lord, Child of Thor

    Anang,

    Ok. I am not sure what Jack did to fix the problem, He just got in there and fixed it. … But that does not matter any longer, that problem is fixed. … After I sent you that message about it being a problem again, I went back through the thread regarding that plugin. … There was a step about logging out, and then re-logging in. … As I went through the steps this time, there was an edit button, and I followed that step, and that problem with the WPMUDEV plugin is resolved.

    I will go look at the MySQL database. … Where does the WIKI data set live? In the same master wordpress database? Or does it have a separate database?

    I will contact you about password information through the contact form.

  • Anang
    • New Recruit

    Hi Jack

    Great, so the WPMUDEV issues resolved then :slight_smile:

    And for WIKI plugins tables, it supposed to be in the same database with wordpress. But not sure if it’s database problem until I can look to your admin dashboard :slight_smile:

    Best Regards

  • Anang
    • New Recruit

    Hi Jack

    I have got your credential info, and have check your site. I check you’re using our WIKI plugins, so could you check on your database on wp_{number}_posts on post_type fields have ‘incsub_wiki’ ? We save the wiki content on posts table , and use incsub_wiki as custom post type.

    Let me know what do you find on your MySql Table :slight_smile:

    Best Regards

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.