Question

Photo of Hock_Hin Lee

0

What are the Prerequisites to copy data from Production Instance to Test Instance of Rock?

I have setup two instances of Rock, one as production and another as test environment.

What are the requirements (other than backup the Rock database from Production and Restore it in Test instance) for this to work?

E.g.

1) Both instances must be at the same Version

2) Both instances must use the same "RockUser" database Login and Password (What is the best solution if I had setup the two instances with same Login Userid but different password?)

  • Photo of David Leigh

    1

    In addition to the points you have mentioned:

    1. Make sure that the login "RockUser" has db_owner permissions for the new database.
    2. The web.config setting "PasswordKey" must be the same for both instances so that passwords are recognized.

    If you're like me, you may also want to run a SQL script to inactivate some scheduled Jobs, such as the Send Communications job to prevent accidental bulk mailouts while testing.
    eg. ( 
    UPDATE [ServiceJob] SET IsActive = 0 WHERE Name = 'Send Communications' )

     

  • Photo of Don Smallman

    0

    Hi Hock Hin,

    I think you should be able to use the same method as one would use if they wanted to move to another hosted server.  You may need to modify the steps if you are installing both production and test DBs on the same server.  Maybe creating a new SQL instance for your test environment would do the trick.  But then you would have to edit the DB in your config file.

    • Create a BACPAC file from the production SQL DB using SQL Management Studio.
    • Install the same version of RockRMS on the test server as you have in production.
    • Delete the default database that RMS installed on the test server
    • Import the BACPAC onto the test server
    • Rename the wwroot folder on the test server to old_wwwroot
    • copy the wwwroot folder from the production server to the test server and voila!

    Since you will keep the DB name and the DB username & password all the same on the test server, you should not have to make any changes to any config files.  Except as noted above.

    Please let us know how it goes.

    • Hock_Hin Lee

      Thanks Don,
      Your method skips the need to install Rock again. Right? (Since you are copying the wwwroot folder over)
      However, does this method require the OS, SQL and IIS to be identical?

  • Photo of Don Smallman

    0

    No, the second step in the process is installing the Rock.  If you are asking if you need to install it again after that, the answer is no.  I have only done this one time, so I cant be sure of the answers to your questions; although I can't think of a reason that the OS or IIS would need to be the same as long as they are close and meet the RMS minimum requirements.  The SQL DB may not have to be the same either, however you would need to change it manually in your DB properties to the installed version after getting everything moved over.  For a seamless transition, I would attempt to make sure that those are all the same.  If there are any developers monitoring this thread, maybe they could chime in. :-)

    Your situation may be much simpler, as you may just need to restore the database each time to keep it up to date.  I guess my first answer was for initially setting up the test server.  Since it is a test server you have the luxury of finding what method works best, but you should not have to install the Rock each time you update the test server data.