This topic is locked

How to store projects in your own database in Version 11.

9/16/2024 12:54:06 PM
PHPRunner Tips and Tricks
Sergey Kornilov

Requires build 42408 or better of PHPRunner 11 or ASPRunner.NET 11.

Important: Use a local database or one on your local network to store projects. Our software requires frequent and intensive communication with the database, making remote databases unsuitable for optimal performance.

If you use MultiDev version of PHPRunner or ASPRunner.NET, make sure that DevServer runs on the same network as your database.

Very important: Do not launch multiple instances of PHPRunner or ASPRunner.NET of different machines pointing to the same project database at the same time. This may lead to corrupted projects. You need MultiDev version of the software to support this kind of scenario.

Supported databases are MySQL, SQL Server, Postgre.

  1. Open version 11 of PHPRunner or ASPRunner.NET. Export projects you want to transfer to your own database. To do so you need to open the project, click Project -> Export. Leave all the default settings and export. Close the project, open the next one and export. This only needs to be done once. By default projects exports are stored in C:\runnerapps folder.


  2. Create an empty database. In my example it is a MySQL database named runnerprojects.


  3. Run version 11 of the software, create a new project and connect to this empty database. Close without saving.


  4. Open file C:\Users\<username>\AppData\Roaming\phprunner\userSettings.config in any text editor and find the connection you just made in the software.



{
"connString": "mysql;localhost;root;;;runnerprojects;;1",
"lastAccess": "Mon Sep 16 2024 12:31:46 GMT-0400 (Eastern Daylight Time)"
}

Copy the connection string.

  1. Open file C:\Users\<username>\AppData\Roaming\phprunner\programSettings.config in any text editor.

Under projectDatabase section change useBuiltinDatabase to false, paste your connection string there. This is how it is going to look.

"projectDatabase": {
"useBuitinDatabase": false,
"connectionString": "mysql;localhost;root;;;runnerprojects;;1"
},
  1. Start the software. You will be offered to create necessary tables in the project database. Click 'Create'.

img alt

This is it. You are now working with your own projects database.

  1. Now you can import the projects you exported on step 1. If you forgot to export project, you can modify programSettings.config again, setting useBuiltinDatabase to true and exporting your projects.


  2. Now you need to import View/Edit plugins into your new projects database. This article explains how this needs to be done:
    https://asprunner.com/forums/topic/30499-Version-11-Frequently-Asked-Questions
    This is also something that only needs to be done once.



Enjoy!

J
Jan K. van Dalen 9/16/2024

Hi, what a welcome news.

With that said, in view that we use both PHPRunner and ASPRunner.net, can both products share a single database?

Thanks

Sergey Kornilov 9/16/2024

Yes, you can store both ASPRunner.NET and PHPRunner projects in the same database but they will appear togther on the list. You can probably add PHP or ASP to the project name to avoide the confusion.

J
Jan K. van Dalen 9/17/2024

Thank you ... great feature

C
Chris Whitehead 9/18/2024

Great feature and works great.

I want to share projects between 2 computers, not to be worked on at the same time, just a laptop and a desktop by the same user, I can see I could have server just for the DB but the reason behind this is so I can work on the desktop and then work on projects when I'm away from home so wouldn't be able to access the projects unless I had them on a webserver, any ideas on which DB would be best for just syncing the files?

Dalkeith 9/18/2024

Can I just clarify - Does this mean that if we want we will be able to Isolate a project to an individual database? PS thanks for the newsletter very useful

C
Chris Whitehead 9/18/2024

@Dalkeith9 I would think yes but might be more fiddly, so they can all be a different DB but it might mean swapping the config files for each one, I'm thinking this more paves the way for multi dev from one DB server.

S
salus2 9/20/2024

Very cool feature. I can defintely see many advantages to this approach. Got me thinking, though, are there any instructions available on how to connect to and interact with the BuiltinDatabase?
Thanks

S
simone65 11/14/2024

Hello, must be there already a schema inside the remote postgres database, or it must be empty and phprunner will create a schema by himself? Thanks

D
DUKE 11/15/2024

If I remember correctly Latin1 / Swedish CI encoding caused some problems on my side with MariaDB.

Switched the database to UTF8MB4 and Unicode - no issues.

R
rkgee 12/11/2024

Nearly works for me...

I get as far as launching v11 after setting up the database on the MySQL server and changing the programSettings.config. After launching phprunner for the first time, It creats the necesary tables in the empty database.

When I try to import one of my exported projects, I get an error pop up saying API - Session not found. And then goes no further.