Jump to content
bowenac

Migrated to WP Engine can't get database connected

Recommended Posts

Hello all, I changed hosts, and trying to get adserver working on WP Engine. I have updated the config to WP Engine database but still unable to connect.

Has anyone got this working on wp engine and know if the config needs something specific... I'm thinking it's the socket path, but not sure if the path is the same on wp engine.

Share this post


Link to post
Share on other sites
Just now, Ian van Marwijk said:

What is exactly not working? :)

The connection to the db.

I updated the config in adserver\var\www.domainname.com.conf.php with the db credentials on wp engine like the following.

[database]
type=mysql
host=localhost
socket="/var/lib/mysql/mysql.sock"
port=13306
username=username
password="password"
name=db_name
persistent=
mysql4_compatibility=1
protocol=tcp
compress=
ssl=
capath=
ca=

 

But when trying to browse to adserver I'm getting the connection error.

A fatal error occurred Revive Adserver can't connect to the database. Because of this it isn't possible to use the administrator interface. The delivery of banners might also be affected. Possible reasons for the problem are: <ul> <li>The database server isn't functioning at the moment</li> <li>The location of the database server has changed</li> <li>The username or password used to contact the database server are not correct</li> <li>PHP has not loaded the MySQL Extension</li> </ul>

Share this post


Link to post
Share on other sites

I just did a new fresh install with a new prefix, and it was able to install a new version just fine.

So then I updated the config of the new install, and pointed it to the old db prefix which seems to work, although I get a login error.

I then updated the old install to use the same database config, and same thing, unable to connect to the db, so I am assuming the old version is just to outdated considering this is on php 7, old server was probably php 5.6

Share this post


Link to post
Share on other sites

Can I not just point the new install to the old db prefix to perform the update? Anyone have simpler documentation on performing an update? I read the update docs but it's extremely confusing.

Share this post


Link to post
Share on other sites

Hi @bowenac,

No, you can't perform a new install of Revive Adserver, and then change it to point to an old version database. The code base on disk from the new install will be set up as if it's already installed, so, there will not be the required filesystem structure in place to "trigger" the upgrade process, and it is non-trivial to reset the file system to do this.

I would strongly recommend that you do not attempt a server migration + MySQL/PHP version update all in one attempt. There are too many moving parts to get things right. I would instead suggest that you take one of two approaches. Either:

  • On your initial server, upgrade MySQL and/or PHP to match the versions that will be used on the new server. This may include needing to upgrade Revive Adserver to support the later versions of the database and PHP, if required. Once you have done this, and the MySQL and PHP versions match what you have on the new server, and Revive Adserver is working, then perform the migration to the new server.
  • OR
  • Ensure that your new server has the same MySQL and PHP versions as your old server. Migrate your Revive Adserver installation to the new server. Once it is working, then look into the required upgrades of MySQL and/or PHP, along with upgrades to Revive Adserver is required.

Share this post


Link to post
Share on other sites

@andrewatfornax and what do you suggest if your host upgrades a server to php 7, and updates mysql to mysqli? Then how would someone go about fixing any issues. It seems like their should be a way to update the config, or some db table rows.

I have followed the docs here on updating https://www.revive-adserver.com/support/upgrading/ which suggest doing a new install, and copying the old database to the new database. I've done this, but get an error when attempting to login.

An error occurred while accessing the database
Due to a problem with the database Revive Adserver couldn't retrieve or store data.

 

And is there not a way to import ads from one install to another? I have the old install, and a new install setup on the server. New install works fine, old install when I update the config to use mysqli it just loads a blank white page. I've read other posts about people just performing an update to adserver which fixes the problem.

Edited by bowenac

Share this post


Link to post
Share on other sites

Hi @bowenac,

If my hosting provider updated my server's PHP and MySQL version without advising me that this was going to happen, I would be screaming down the phone at them and demanding an immediate provision of a server like I had, followed by assistance to migrate the database data and code from my server over to that new one, so that things worked again as they were.

Then I would start the process of upgrading as it should be followed.

To answer your other questions:

1. The upgrade documents you have linked to do not suggest doing a new install and copying the old database to a new database. They say you should copy your old database to a new database, and then upgrade using the new database. This ensure that your old database is still around in case things don't work, and you need to roll back. Doing a new install and THEN trying to copy the data from your old database will not work.

2. No, there is no way to import ads from one install to another.

 

Share this post


Link to post
Share on other sites
1 hour ago, andrewatfornax said:

Hi @bowenac,

If my hosting provider updated my server's PHP and MySQL version without advising me that this was going to happen, I would be screaming down the phone at them and demanding an immediate provision of a server like I had, followed by assistance to migrate the database data and code from my server over to that new one, so that things worked again as they were.

Then I would start the process of upgrading as it should be followed.

To answer your other questions:

1. The upgrade documents you have linked to do not suggest doing a new install and copying the old database to a new database. They say you should copy your old database to a new database, and then upgrade using the new database. This ensure that your old database is still around in case things don't work, and you need to roll back. Doing a new install and THEN trying to copy the data from your old database will not work.

2. No, there is no way to import ads from one install to another.

 

 

Ok I read it again and yea it's just creating an adserver_new directory to keep the old as a backup, and then copying the config file, and to create a new database and import the old data... I also tried this as well, but couldn't get it to work on the new server. Was having login issues.

Ended up deciding to just do a fresh install of adserver and reconfigure the ads. Took less time than trying to debug what the issues was, and everything is up to date and running better on the new server.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×