Clone a project from either OSS to Enterprise or from an Enterprise project to another Enterprise project.
Download the ZIP of this Gist, then install using
npm install
| wget https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem | |
| mongodump --ssl \ | |
| --host="<cluster-name>.<region>.docdb.amazonaws.com:27017" \ | |
| --db=formio \ | |
| --archive=formio.gz --gzip \ | |
| --username="<yourUsername>" \ | |
| --password="<yourPassword>" \ | |
| --sslCAFile global-bundle.pem |
| db.projects.find({_id: {$in: [ | |
| ObjectId('63ebe4e2902342342db152a8'), | |
| ObjectId('642324234234a13675034017'), | |
| ObjectId('642c68506234234234241869'), | |
| ]}}).forEach(function(project) { | |
| print('Deleting project ' + project.name); | |
| db.forms.find({project: project._id}).forEach(function(form) { | |
| print('Deleting revisions for ' + form.title); | |
| db.formrevisions.deleteMany({form: form._id, project: project._id}); | |
| print('Deleting submissions for ' + form.title); |
| db.projects.find({name: 'formio'}).forEach(project => { | |
| db.projects.updateMany({}, {$set: {owner: project.owner}}); | |
| db.forms.updateMany({}, {$set: {owner: project.owner}}); | |
| db.submissions.updateMany({}, {$set: {owner: project.owner}}); | |
| db.actions.updateMany({}, {$set: {owner: project.owner}}); | |
| db.tags.updateMany({}, {$set: {owner: project.owner}}); | |
| }); |
| import debounce from 'lodash/debounce'; | |
| @Component({ | |
| ... | |
| }) | |
| export class MyController { | |
| public submission = {}; | |
| ngAfterViewInit() { | |
| var currentSubmission = localStorage.getItem('currentSubmission-' + this.route.params.formId); | |
| if (currentSubmission) { | |
| this.submission = JSON.parse(currentSubmission); |
| PORT=3010 | |
| FORM=http://localhost:3000/sql/routes | |
| DB_TYPE=mysql | |
| DB_HOST=localhost | |
| DB_NAME=formio | |
| DB_USER=root | |
| DB_PASS=CHANGEME |
| import { Formio } from 'formiojs'; | |
| @Component({ | |
| selector: 'app-root', | |
| templateUrl: './app.component.html', | |
| styleUrls: ['./app.component.scss'] | |
| }) | |
| export class AppComponent implements AfterViewInit, OnInit { | |
| constructor(public auth: FormioAuthService) {} | |
| ngOnInit() { |
| <formio-alerts [alerts]="service.alerts"></formio-alerts> | |
| <formio-grid | |
| [src]="gridSrc" | |
| [query]="myQuery" | |
| [onForm]="service.formLoaded" | |
| (rowSelect)="onSelect($event)" | |
| (error)="service.onError($event)" | |
| (createItem)="onCreateItem()" | |
| [createText]="createText" | |
| ></formio-grid> |
| /** | |
| * Cleanup the database. This script does the following. | |
| * | |
| * Run this using | |
| * node cleanupdb.js --NODE_CONFIG='{"src": "mongodb://localhost:27017/formio"}' | |
| */ | |
| const config = require('config'); | |
| const mongodb = require('mongodb'); | |
| const MongoClient = mongodb.MongoClient; |