How to migrate development to production

Migrating development to production is very simple in Jam.py due to the ability to export and import its metadata.

To understand the concept of metadata and the process of exporting and importing metadata, please read the topic Export/import metadata. The process of importing metadata depends on the type of project database.

New project migration

  • Create an empty database in the production environment

  • Run jam-project.py script to create a new project

  • Set up the server. See

  • In the browser start the Application Builder and finish the creation of the project with an empty database.

  • open Parameters dialogue to set up the project. Setup the following parameters:

    • Production to true

    • Safe mode

    • Debugging to false

  • Export the metadata of the development project to a zip file in the Application Builder by clicking the Export button.

  • Import the metadata to the new project.

Note

For projects with SQLite database you can simply copy the development project folder to the production environment.

Existing project migration

  • Export the metadata of the development project to a zip file.

  • Import the metadata to the production project.

Note

For SQLite database, Jam.py doesn’t support importing of metadata into an existing project (project with tables in the database). You can only import metadata into a new project.

Importing metadata with the http server process shutdown

Stop the http server and copy the metadata zip file to migration folder in the project directory. If the folder doesn’t exist, create it.

Start the http server. The web application, while initializing itself, will import the metadata file. You can see the information on how the file was imported in the log file in the logs folder of the project directory. If the import is successful, the zip file will be deleted.

Importing metadata without the http server process shutdown

Click the Import button in the Application Builder.

Note

By default the web application in the process that imports the metadata waits for 5 minutes or until all previous request to the application in this process will be processed before it starts to change the database. For projects that run on multiple processes you can set the Import delay parameter in the Parameters to delay the change the database or use Importing metadata with server shutdown.