Pages

Wednesday, June 3, 2015

How to export/import your MorphX VCS settings and history

When using MorphX for version control, sometimes you need to restore a backup of a database, and you don't want to lose all of your check in/out history.  I wrote this job to export and import your MorphX VCS settings.

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!");
    }
}

15 comments:

  1. Hi Alex

    I 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

    ReplyDelete
    Replies
    1. 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.

      I just quickly wrote the job because I was about to refresh a database and didn't want to lose it without much google searching.

      Delete
  2. A 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
  3. This article was written by a real thinking writer without a doubt. I agree many of the with the solid points made by the writer. I’ll be back day in and day for further new updates. Shipping Container

    ReplyDelete
  4. DumpsCafe is a Premium Supplier of Real Exam Questions and Certification Exam Dumps. DumpsCafe.com is the ultimate choice for IT students to pass their final exams in a quick time. https://www.dumpscafe.com/Braindumps-TA-002-P.html

    ReplyDelete
  5. I might endorse composing a initial DCCR (DECLARATION OF COVENANTS, CONDITIONS AND RESTRICTIONS). You can try this earlier than you even keep for a deliver. Write your model of the way you envision the shared possession of a cruise deliver because it have to be.Shipping from china

    ReplyDelete
  6. Good evening guys! We have been in writing business for an extended period where we have understood the challenges students go through in their education life. Writers from https://essaysrescue.com/grademiners-review/ have developed the right skills to customize each student’s need and deliver the service that suits them. When it comes to quality, we are among the leading establishments that deliver premier papers.

    ReplyDelete
  7. Use the information out there on casino blogs and casino sites to your advantage. Browse through forums, spend some time on Reddit, and 원 엑스 벳 skim what Las Vegas and Atlantic City gamers say about every sport. Space Wars is a fast-paced video slot with 5 reels, four rows, and forty paylines. Instead of focusing on the generic tips and tips you find on all casino guides on the web, it focuses on proven methods to enhance your odds when you choose the video games to play. Thirdly, the final knowledge is that you simply wish to make the maximum guess if you play. Many slots solely provide their largest prizes to people who guess the max.

    ReplyDelete
  8. Stones and Cabinets City delights our customers and makes them proud of their houses by making the complex simple.

    ReplyDelete
  9. Sharing your cell phones can be risky. But with I-Cell Station's trustworthy services, we promise to keep your data stored,

    ReplyDelete
  10. Constructing a house in DHA (Defence Housing Authority) Karachi is a popular dream for many residents,

    ReplyDelete
  11. We deliver big ideas and even bigger results with more agility and efficiency than larger digital agencies.

    ReplyDelete
  12. E-Biz, a leading digital marketing agency, commenced its journey in Ireland as a Printing &

    ReplyDelete
  13. Our team has experience bringing in both e-commerce sales as well as service leads.

    ReplyDelete