Copy full Product line and data from PROD to TEST

 6 Replies
 0 Subscribed to this topic
 27 Subscribed to this forum
Sort:
Author
Messages
Ari
Veteran Member
Posts: 49
Veteran Member

    I am going to copy our Production Productline to our Test Productline. We are on Windows LSF9 with SQL Database. I have looked at Lawson's AMT procedure for Copying the Productline. This looks straight foward, but I have a couple of questions.

    1. Once you have run the appmetadiff, copied the Productline directory, run the appmetaload, run the blddbdict; is it nessessary to run the dbreorg even if  a new dictionary was created? If you are copying the Production Database to the Test Database  it would seem that the Dictionay file would be in sync with the Test Database because it was copied from Production. 

    2. Why is it nessassary to recompile the programs if they are all copied from a Productline that is working correctly?
    Jimmy Chiu
    Veteran Member
    Posts: 641
    Veteran Member
      1) If a new dictionary is created, it simply means there are new changes in your database dictionary, dbreorg will make these changes create/modify/delete to tables/columns etc. So yes, you need to run dbreorg especially you get new dictionary is created during blddbdict.

      2) if you followed the steps from AMT, there are steps where you are told to delete all \obj and \int files. you need to recompile to repopulate them.

      Ari
      Veteran Member
      Posts: 49
      Veteran Member
        Thank you for the response, but my questions still stand.

        1)  I understand that if a new dictionary is created, it simply means there are new changes in your database dictionary.and if you run the dbreorg it will make those changes to the to the application database. My question is, since I have copied the PROD Database to TEST, aren't those changes already in the TEST Database? A new dictionary file would have been created because the old dictionary is not in line with the GEN Database that was updated with the appmetaload. Once I run blddbdict shouldn't it create a dictionary file that is now describes the TEST database and thus makes it unnecessary to run the dbreorg?

        2)  I should have been more clear here. I would not delete the obj and the int directories after I copied the PROD directories to the TEST directories. Would I still need to delete them and recompile the source programs in the TEST Productline? I am not trying to be argumentative here. I just am wondering what is the point of recompiling source programs that are already working correctly?
        John Henley
        Posts: 3353
          This is all dependent on whether or not TEST already existed. In other words, are you building TEST as a new product line, or does it already exist. If it is a new product line, then 1) you would run dbcreate against an empty database (rather than dbreorg) and 2) you would need to compile in order to update the GEN metadata. If you are just refreshing -- and you haven't made ANY changes to the underlying tables, metadata, etc. -- then you wouldn't have any dictionary changes and recompiling wouldn't be necessary. If that is the case, all you really need to do is bring the PROD database over and restore/attach it in place of the existing TEST database.
          Thanks for using the LawsonGuru.com forums!
          John
          Ari
          Veteran Member
          Posts: 49
          Veteran Member
            OK.
            This is not a new Productline. The TEST Productline already exists.
            This is not a Data Refresh. The TEST Productline and the PROD Productline are not in sync. They are, however,  in the same environment. It would be a complete PROD to TEST Productline copy including data.

            What I am asking is if I do the the steps that include the metadata extract (appmetadiff -s) for PROD and then copy PROD Directory to TEST and then do the metadata import (appmetaload) in TEST, shouldn't the GEN database now have the same info for both PROD and TEST?

            After that if I do the blddbdict in TEST shouldn't it create a data dictionary for TEST that would be the same as the one for PROD?

            If I now copy the PROD Database to TEST wouldn't the Data Dictionary be in sync for the TEST Database?

            Also, why at this point would I want to recompile the programs?
            John Henley
            Posts: 3353
              Posted By Ari on 04/10/2012 02:15 PM
              OK.
              This is not a new Productline. The TEST Productline already exists.
              This is not a Data Refresh. The TEST Productline and the PROD Productline are not in sync. They are, however,  in the same environment. It would be a complete PROD to TEST Productline copy including data.

              What I am asking is if I do the the steps that include the metadata extract (appmetadiff -s) for PROD and then copy PROD Directory to TEST and then do the metadata import (appmetaload) in TEST, shouldn't the GEN database now have the same info for both PROD and TEST?

              Theoretically yes, except potentially you might have items that existed (i.e. a table or an element, etc.) in TEST that no longer exists in PROD. Those items would not be removed by this process. I have also seen instances where appmetaload apparently doesn't completely load everything, and an appmetadiff on the target product line finds differences.  

              After that if I do the blddbdict in TEST shouldn't it create a data dictionary for TEST that would be the same as the one for PROD?

              If the TEST dictionary already exists, then you would get +TEST and therefore would need to do a dbreorg to swap in the updated dictionary.

              If I now copy the PROD Database to TEST wouldn't the Data Dictionary be in sync for the TEST Database?

              Yes

              Also, why at this point would I want to recompile the programs?

              The appmetaload only loads certain metadata artifacts.  Compiling updates certain GEN tables with other program/field/table usage artifacts.

              If you want to do this correctly, and with 100% certainty, the ONLY way I recommend is to remove the existing TEST product line first.
              Thanks for using the LawsonGuru.com forums!
              John
              Ari
              Veteran Member
              Posts: 49
              Veteran Member
                OK. Thanks. This makes sense now.
                I can see the points are:
                  
                1)  Do an appmetadiff on the TEST productline to make sure the Metdata got loaded correctly to GEN.

                2)  Run the dbreorg because even though the database is in sync with the +TEST data dictionary it still nees to be turned into the TEST data dictionary in order for the Productline to function correctly.

                3)  Compile the programs in TEST because the process puts some Metadata info into the GEN database that is needed.