Use at your own risk, but it's worked fine for me.
Enjoy!
static void AKBackupMorphXVCData(Args _args) { SysDataExport sysDataExport; SysDataImport sysDataImport; Dialog dialog = new Dialog(); FormBuildRadioControl fbImportExport; FormRadioControl radioResults; dialog.addText("Warning, if you choose Import, this will replace your VCS data and is not reversible!"); // Add the radio button, name it anything fbImportExport = dialog.formBuildDesign().addControl(FormControlType::RadioButton, 'RadioButton1'); fbImportExport.caption("Choose Import/Export"); fbImportExport.items(2); fbImportExport.item(1); fbImportExport.text("Export"); fbImportExport.item(2); fbImportExport.text("Import"); dialog.doInit(); dialog.formRun().design().moveControl(fbImportExport.id()); dialog.run(); if (dialog.closedOk()) { radioResults = dialog.formRun().control(fbImportExport.id()); if (radioResults.selection() == 0) // Export { sysDataExport = new SysDataExport(); sysDataExport.parmDoNotBypassDefIO(true); sysDataExport.parmServerAccess(true); sysDataExport.addTmpExpImpTable(tableNum(SysVersionControlMorphXItemTable), false); sysDataExport.addTmpExpImpTable(tableNum(SysVersionControlMorphXLockTable), false); sysDataExport.addTmpExpImpTable(tableNum(SysVersionControlMorphXRevisionTable), false); sysDataExport.addTmpExpImpTable(tableNum(SysVersionControlParameters), false); sysDataExport.addTmpExpImpTable(tableNum(SysVersionControlSynchronizeLog), false); if (sysDataExport.prompt()) { sysDataExport.parmFiletype(FileType::Binary); sysDataExport.run(); } } else if (radioResults.selection() == 1) // Import { sysDataImport = new SysDataImport(); if (sysDataImport.prompt()) { sysDataImport.parmLoadAll(true); sysDataImport.parmInclTablesNotPerComp(true); sysDataImport.parmFiletype(FileType::Binary); sysDataImport.run(); versioncontrol.init(); } } info("Done!"); } }
Hi Alex
ReplyDeleteI documented another way to do this on my blog post at http://www.k3technical.com/moving-morphx-version-control-data/. I didn't include the version control parameters table in my solution although there's no reason why you couldn't.
Malcolm
Ah, different way of accomplishing it. I'd have thought you'd have had issues with RecId's, but it sounds like you didn't.
DeleteI just quickly wrote the job because I was about to refresh a database and didn't want to lose it without much google searching.
Amazing post
ReplyDeleteA lot of students consider Morphx quite difficult as the settings are not easy to understand but essay writing services has made it quite easy and for the professionals as well as thee students who are new in this field and want to grow.
ReplyDelete