No data received after server migration

I am in the midst of transferring my data from one server to another (with a new IP). I have created all the databases on the new server, but I had to change the database username on the new server. I made these changes in db-config.php and wp-config.php.

Now the site will not load. I noticed if I alter creds in the config files that the site will render a "Error establishing a database connection", so I know it's talking to the MySQL server, but I don't know why my sites aren't working.

FWIW, other .php type sites are working on this server, so it appears that the right PHP handler is in place and working.

Can you make any suggestions?

  • Vaughan
    • Support/SLS MockingJay

    Hi @nwtd,

    Are you actually using Multi-DB on your old site you transferred from?

    The db user in wp-config.php should be the same as your main db username & pass in the new server.

    sometimes they have a prefix attached to them. usually the same as the username you use to login to CPanel with.

    So if your DB name is test & your CPanel username is usernam1

    Then your DB name would be usernam1_test

    Your Username would be usernam1_dbusername

    You will need to also make sure all the URLs match your new domain (if it's a different domain) in wp_sitemeta, wp_options & wp_posts.

    Hope this helps

  • NWTD
    • The Incredible Code Injector

    Multi-DB was setup and functioning on my old server. The domain has not changed, just the IP. I just migrated to a new server. The MySQL username and password in cPanel match everything in the config files. Is there anything that related to the file structure?

    The old server had a file structure like /var/www/vhosts/domain.com/ where as the new server is like /home/user/public_html/

  • NWTD
    • The Incredible Code Injector

    @Vaughan Thanks for the suggestions. My .htaccess is pretty plain jane:

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress

    From another browser I'm getting an error 502 bad gateway...so maybe it's something with my host.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.