Backup
  • 1 Minute to read
  • Dark
    Light
  • PDF

Backup

  • Dark
    Light
  • PDF

Article summary

Creates a backup of a project's mongo data that can then be restored onto the same or another machine using the Restore method.   Two backup modes are possible: 

  • Project
  • System

Method

KeyValue(s)Description
method"Backup"Stores a copy of project's mongo data in a zip file.
targetproject"projectname"Required. Name of project to backup
path"pathandfilename"[path] or [path and filename] of zip file to create.
Recommended practise is to create a Backups folder underneath DataSources.
If filename is not provided, the filename will be "ProjectName_" & %DSTAMP%
project"projectname"The current project.
systemtrue/falseOptional.  Default = false.  If true, a system backup will be created.   Note that targetproject does not apply when doing a system backup and must be ""
tables[][
"Table1",
"Table2",
"..."
]
Optional.  List of tables to include in the package.  If omitted, all tables in the project will be included.
reports[][
"Report1",
"Report2",
"..."
]
Optional.  List of reports to include in the package.  If omitted, no reports will be included.

Backup should return within a few seconds - if it doesn't this indicates there is an underlying issue with the system, in which case speak to a system administrator.  Project Backup needs to be run once for every project that requires backing up. System Backup only needs to be run once against a particular realm.

Example

Project Backup

The following will create a Backup file called %DATAPATH%Backups/MainProject1.zip for the MainProject1 project.  (Note %DATAPATH% is the location of the DataJet Datasources folder).  Note that Backup files contain only the project objects - they do not contain any data files.  To restore data from a Backup file, use the Restore method.  

{
  "method": "Backup",
  "path": "%DATAPATH%Backups",
  "description": "Backup Existing Project",
  "targetProject": "MainProject1",
  "system": false,
  "project": "TestProject"
}

System Backup

The following will create a System Backup file of all projects in the realm. This includes Stored Scripts, Plugins and User Defined Functions.    To restore data from a system backup file, use the SystemRestore method.

{
  "method": "Backup",
  "path": "%DATAPATH%Backups",
  "description": "Backup Staging System",
  "targetProject": "",
  "system": true,
  "project": "TestProject"
}

Using Backup to create an Injection Package

The following will create a package that can be used to inject shared data from one realm into another realm.    Note:  To inject data in the same realm, use InjectTables.

(Note: It is only possible to inject data across realms if the system has been configured to allow multiple realms access to a shared data path.)

{
  "method": "Backup",
  "path": "%DATAPATH%InjectionPackage.zip",
  "tables": [
    "Sales",
    "Customer"
  ],
  "reports": [
    "Sales Over Time"
  ],
  "targetProject": "Demonstration",
  "project": "Demonstration"
}







Was this article helpful?

What's Next