Uploaded image for project: 'OpenMRS SDK'
  1. OpenMRS SDK
  2. SDK-167

SDK should have an option for using a pre-created database upon setup

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Should
    • Resolution: Fixed
    • None
    • 3.7.0
    • None
    • None

    Description

      Frequently, when I want to set up a new server using the SDK, I want to connect that SDK to an existing database that I already have installed.

      For example, I may have a very large database that I want to restore into a dev or test environment that is based on a production system, and this database takes an hour or more to load. I want to do this once and if for whatever reason I need to re-create my server install from scratch, I don't want to have to re-import the DB during this process.

      Perhaps this is already the behavior that happens, but it wasn't clear to me one way or another - but if I specify database XYZ, and this database already exists, then the setup should simply use the existing DB and not create a new one based on a starter SQL script.

      Approach to take
      After the user specifies dbUri and credentials, the SDK should check, if the DB has any tables. If it does, it should prompt the user:

      The 'DBNAME' database is not empty. Would you like to setup the server using existing data (if not, all data will be lost)? [Y/n] (-DdbReset):
      

      If -DdbReset=true/false is specified in the command line, you should not prompt the user.

      Gliffy Diagrams

        Attachments

          1. RUN_EXISTINGDB_1
            790 kB
          2. RUN_EXISTINGDB_2
            72 kB
          3. RUN_NEWDB
            237 kB
          4. SETUP_EXISTINGDB
            12 kB
          5. SETUP_NEWDB
            12 kB

          Activity

            People

              tmarzeion Tomasz Marzeion
              mseaton Mike Seaton
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 7 hours, 30 minutes
                  2d 7h 30m