There are a few steps required to set  up your application in production:

  1. Define your database and set it up with primary data (lookup tables etc.)
  2. Upload the project. 


Define database and setup with primary data

Deploying a database is not something that is supported within PHsPeed utilities. The main reason is that there are many databases out there, and they all have different requirements. Most of you will probably use tools that are dedicated to the database of choice. But there are some basic things that you can use. 


PHsPeed comes with phpMyAdmin and Adminer. The embedded Browser does not allow downloads and uploads, so you need to start phpMyAdmin or Adminer in a different browser. If you have set up PHsPeed to start other browsers, you can select them from the list. Using these tools allows you to dump your database structure and data to be loaded in your production database. If you use MySQL/MariaDB, then your provider most likely supports phpMyAdmin, and you can import your exported file. 

If you use the Role-Based-Access module, you must start with a primary admin user to set up a decent role model. In the vault section, you find a default application to add a first user to your database. After adding the user, the application will generate an error message if you try to add another one with that application. 



Although this example describes the procedure around MySQL/MariaDB, the other databases have a similar approach. And you can always use the tools that come with your database.

Upload your project

There are several ways to upload your project. You can upload this directory to the server if you have set up and tested the promoted code in your test environment. That is the most convenient way. PHsPeed comes with an FTP client, but its use is limited as it currently does not support ftps and supports only one upload channel. But it fits for simple tasks. 



One helpful feature is to create a zip file of your deployment environment:




The created zip can be uploaded and unpacked.

But for experienced developers, you can use any FTP client of choice that supports more features like the (free) FileZilla.

Deployment file structure

Depending on the webserver you use, your root is htdocs for apache or wwwroot for IIS. It is possible that you don’t see this when you use shared hosting.  If you want to host only one PHsPeed project, then you can consider using private libraries. The structure will be as follows


Myprj

  • _libs
    • _extlib
    • _extlibphp
    • css
    • fonts
    • images
    • js
    • languages
    • php
    • all your project generated files

workarea


If you prefer, or host more projects on the same server, then you can consider using shared libraries. The structure will then be:


_libs

  • _extlib
  • _extlibphp
  • css
  • fonts
  • images
  • js
  • languages
  • php

Myprj

  • _libs
    • all your project generated files

workarea



The choice of using shared libraries or private libraries depends on how you want to maintain your projects.


Shared libraries

All projects share the same libraries. That means that if the libraries are changing that it will apply to all projects. However, the advantage is a significant lower diskspace as the libraries will not be replicated in each project. Therefore you need to test all projects in advance before upgrading. 


Private libraries

If you use private libraries, then you can upgrade every project one by one. That can be an advantage if you have a lot of projects. The disadvantage is a higher footprint as each library occupies space and requires uploading.


Best practice

When a major upgrade is available, and you have many projects using shared libraries, then create a new subdirectory so that you can move your project one by one from the old to the new folder.


I.e.:

Htdocs\v1\myproject -> htdocs\v2\myproject

That way, you can still test applications one by one. If you are done, the user needs to use the new folder, which you can force by redirecting the old directory.