This topic is locked
[SOLVED]

 Connecting to MySQL DB after moving app to a different hosting company

2/16/2015 4:50:30 PM
PHPRunner General questions
C
CPSRob author

This is my first post to the forums so I apologize in advance for being green as grass. I have been digging around looking for a solution and maybe I just missed it. This seems like a variation on Thread 7127. I am running PHPRunner Enterprise 8.0 (Build 22714 x86). I have started doing some contract work for a friend who has been running PHPRunner for years. I am just learning it. I am nervous about having him turn me loose in his production environment so he set me up on another host but with the same tables. As one would expect, the different host requires a different database prefix. That makes cross development very difficult. We seemingly can't just copy the production PHPRunner software and database to the new host because of the prefix requirements and also because of the user, password, and database name being imbedded in the application. Not worrying about the MySQL database for the minute, is there a way to change the connection information in the application after it is uploaded to the server? Forum 7127 referred to include/dbcommon.php but I can't seem to find it. I would think that for people who have disaster recover sites, this would be a common issue. Any assistance would be greatly appreciated. Thanks, Rob

C
chuckbower 2/16/2015



This is my first post to the forums so I apologize in advance for being green as grass. I have been digging around looking for a solution and maybe I just missed it. This seems like a variation on Thread 7127. I am running PHPRunner Enterprise 8.0 (Build 22714 x86). I have started doing some contract work for a friend who has been running PHPRunner for years. I am just learning it. I am nervous about having him turn me loose in his production environment so he set me up on another host but with the same tables. As one would expect, the different host requires a different database prefix. That makes cross development very difficult. We seemingly can't just copy the production PHPRunner software and database to the new host because of the prefix requirements and also because of the user, password, and database name being imbedded in the application. Not worrying about the MySQL database for the minute, is there a way to change the connection information in the application after it is uploaded to the server? Forum 7127 referred to include/dbcommon.php but I can't seem to find it. I would think that for people who have disaster recover sites, this would be a common issue. Any assistance would be greatly appreciated. Thanks, Rob


Rob, at build time there is an option to create another set of database connections. It is on the Output page/section of PHPRunner. You can create a new database connection and set your values there. Test all you want, then when you are ready to build final you can change back. Look at the section and you can see what I mean.
Chuck

Sergey Kornilov admin 2/16/2015

Yes, you can create a set of 'Server Database Connection' settings on 'Output directory' screen and choose correct connection before build and upload.

C
CPSRob author 2/17/2015



Rob, at build time there is an option to create another set of database connections. It is on the Output page/section of PHPRunner. You can create a new database connection and set your values there. Test all you want, then when you are ready to build final you can change back. Look at the section and you can see what I mean.
Chuck


Chuck and Sergey,
Thank you so very much for your prompt replies. Yes, that will certainly seem to get me past my current "taking a production application that was originally sent to one host" and then "build and send it to another host for testing" problem. I'm just waiting for my friend to supply me with FTP parms so I can actually test it.
By the way, although I am completely new to PHPRunner (an absolutely Wizard piece of software, by the way), I have been banging out code for a living since June, 1975, so if I ask questions of a kind of "theoretical" nature, it is just my old I.T. age showing.
With that in mind, returning to my other "disaster recovery" remark (I worked for a bank for 12 years), let's say you are on a host where your prefix is AAAA1111 for both your databases and your userid. Your backup site has a prefix of BBBB2222. I know this is hypothetical, and if no one wants to take the time to answer, I certainly understand (or if this is not the right place to post, ditto), might it not be nice to be able to specify %%%%%%%%_ as your database and userid prefix in PHPRunner and then put a PHP file on each of the hosts (ala the New Connection dialog) with the substitution string? Then the applications could just be moved from one host to the other and nothing would have to be reloaded or rebuilt. I'm probably toxically stupid. I apologize in advance. Thanks, Rob

Sergey Kornilov admin 2/18/2015

While I understand the idea of making transfers easier database prefix is not the only thing that can possible change. In many cases you will have to change host, user and password as well and this is what 'Server database connection' option is for.

C
CPSRob author 2/18/2015



While I understand the idea of making transfers easier database prefix is not the only thing that can possible change. In many cases you will have to change host, user and password as well and this is what 'Server database connection' option is for.


Sergey, thanks for taking the time to reply. I'm sure you have much more important things to do. As I said, great piece of software you have here! By the way, I finally got the FTP information from my friend and although I had to enter the new connection information both on the Output screen and then the first time FTP wanted to use it, it worked like a champ so I am one happy camper! Thanks for everything! Best Regards, Rob