Jam.py documentation

copy_database

copy_database(self, dbtype, database=None, user=None, password=None, host=None, port=None, encoding=None, server=None)

domain: server

language: python

class Task class

Description

Use copy_database to copy database data when migrating to another database.

See How to migrate to another database

Example

in the following code when the project task tree is created the application copies the data from the demo.sqlite database to the project database:

from jam.db.db_modules import SQLITE

def on_created(task):
    task.copy_database(SQLITE, '/home/work/demo/demo.sqlite')