This topic is locked
[SOLVED]

  Manage Live and Test system

6/10/2012 5:01:51 PM
PHPRunner General questions
R
rstackhouse author

What procedure is required to manage both a live and a test system?
Its clear you need two env's .. one that is "live" and one that you are doing development on.. so you need 2 databases and two web servers (or xapps etc)
Its also clear that the "OUTPUT" section is where PHPRunner is setup to accommodate both setups.
The web output folder clearly is setup so that after a build you can "ftp" (or other) to the live site when ready.
What's not clear to me is what needs to change on the database side. I understand the tables need to match so any new tables or structure needs to be updated. I tend to want to do that via a database sync tool like Navicat. Is that the full purpose of the table sync at the datasource view of PHPRunner?
Are you supposed to change the output window from my debug/local host to my live one and then do a build? Or do I need to do anything after syncing up.
I didnt find anything about dealing with this in the documentation. Perhaps a recipe or short white paper on "How to" would be useful.

Sergey Kornilov admin 6/11/2012

You have mentioned two different processes here. Let me explain the difference.
'Database sync' option in PHPRunner synchronizes changes in database structure with project itself. If you change database structure outside of PHPRunner do database sync so PHPRunner can pick new fields and drop old ones. You can also proceed to Project->Settings and choose to synchronize project and database automatically on each project load.
Synchronization of local and remote databases is a different story. This needs to be done outside of PHPRunner. Many database management programs can do that.

More info: http://stackoverflow.com/questions/876731/how-to-compare-mysql-database-schemas

R
rstackhouse author 6/11/2012



You have mentioned two different processes here. Let me explain the difference.
'Database sync' option in PHPRunner synchronizes changes in database structure with project itself. If you change database structure outside of PHPRunner do database sync so PHPRunner can pick new fields and drop old ones. You can also proceed to Project->Settings and choose to synchronize project and database automatically on each project load.
Synchronization of local and remote databases is a different story. This needs to be done outside of PHPRunner. Many database management programs can do that.

More info: http://stackoverflow.com/questions/876731/how-to-compare-mysql-database-schemas

R
rstackhouse author 6/11/2012

Ok.. thanks.. so sync is really to bring PHPRunner up to date.. and its not required for when you modify the table inside PHPrunner in the first place. Understood.
Now.. at output... I assume some file contains the host, password and port etc... If I "build" for my local machine.. and then ftp the results to the server.. Did I have to change the database? Does that mean that the change of database now makes my local env try to read the remote/live database?
The output panel holds some confusion for me.. Since you can select your build target (which I do local) and database, which I keep at local.. then ftp the files up to the live server.. Its unclear to me and a little ambiguous to me if I have to change the database, build then ftp or leave it, etc.. Therefore right now I build more often
An added issue is if I build All and/or ftp all files. When there's confusion.. Its better to do more than less file copying.. and I'm trying to understand the finesse of phprunner.

P
procheck 6/13/2012



Ok.. thanks.. so sync is really to bring PHPRunner up to date.. and its not required for when you modify the table inside PHPrunner in the first place. Understood.
Now.. at output... I assume some file contains the host, password and port etc... If I "build" for my local machine.. and then ftp the results to the server.. Did I have to change the database? Does that mean that the change of database now makes my local env try to read the remote/live database?
The output panel holds some confusion for me.. Since you can select your build target (which I do local) and database, which I keep at local.. then ftp the files up to the live server.. Its unclear to me and a little ambiguous to me if I have to change the database, build then ftp or leave it, etc.. Therefore right now I build more often
An added issue is if I build All and/or ftp all files. When there's confusion.. Its better to do more than less file copying.. and I'm trying to understand the finesse of phprunner.


You will need a different configuration for your local & remote databases. You can find an example in the manual in 2.18 Output directory settings.

When you change configurations, you will need to rebuild your app. You also have the option of changing your output location for each configuration

if desired.
Build All will regenerate all your files locally and FTP All files will copy all your files remotely. Your output files will all be uploaded the first time you publish remotely. After that you only need to update the changed files. Occasionally you might need to refresh all the files remotely.

R
rstackhouse author 6/13/2012

good discussion..
With super powerful "gui builders" the biggest concern is rebuilding a lot of code that you think was working right and may or may not have gotten changed.. 100% of your project becomes a potential for QA testing. I'd like to believe that I didnt have to rebuild everything after I tested the local version and in fact there is a lot of power in being able to upload to the live server and test the code there but under a different than "active" version.
Assuming you are doing all your db changes external to phphrunner and doing it with all due consideration to the test and live database.. the only thing left is the guts of what phprunner writes out.
I am thinking for example that I should probaly upload to <project>_timestamp and then use soft links (ln -s) or apache links to point to the build I want to be "live"
Then if there is a problem, after considering the changes you may have made to the database, you could also back off of a release in an emergency.
"With great power comes great responsibility" --Spiderman's step dad
and the power of PHPrunner would be greatly enhanced if these types of issues were considered..

P
procheck 6/13/2012

You're only generating the code that you've created with PHPRunner which includes your custom changes. The only thing which requires testing is what is affected by your changes. Now a table change can potentially touch many screens but I would think that is more of a design issue. PHPRunner will only do incremental changes if that's what you require. I think the best thing for you to do play with a test application locally & remotely and make small changes to see how it works.
When you create your own application, like any type of development you will need to version. I've found that a good MySQL manager can help to keep your database changes in sync your application versions.