How to Do SAP System Copy? – A Step-by-Step Guide

Posted · 6 Comments
SAP System Copy

An SAP system copy is one thing a SAP Basis administrator will undoubtedly be asked to do. It is common for companies to want their SAP test system to look like their production system and thus, will require a copy of SAP system. It may even be on a regular basis (i.e. quarterly). It is our intention to walk you through the steps of performing an SAP system copy by detailing (1) pre-copy steps, (2) copy steps, and (3) post-copy steps.

This procedure expects that the SAP system and Oracle are already installed and the system copy is just a database switch.

A. Pre-Copy Steps

  1. Note what date / time to which you will restore.
  2. Issue a freeze on transports to TEST. Emergencies will then go directly to PRODUCTION (if a different TEST system is not available).
  3. Note all transports that have not gone into PRODUCTION, but are in TEST.
  4. Note all transports that have gone to PRODUCTION after the date / time of the restore point.
  5. Shutdown SAP and Oracle on the TEST system.
  6. Remove all Oracle data files on TEST.

B. SAP System Copy Steps

DescriptionInstruction
Copy filesUsing the restore date and time, copy PRODUCTION data files, log files, and controlfile from tape to  TEST.
Modify Control FileModify the control file to match the directory paths for TEST.
Rename databaseIn SQLPLUS, perform the following command:
ALTER SYSTEM SET DB_NAME=<TEST SID> SCOPE=SPFILE;
Recover databaseUse the Sqlplus command:
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL TIME ‘YY-MM-DD:HH24:MM:SS’;
The date / time will depend on the time you want to restore to.
After this is complete, startup Oracle.
Check R/3 ConnectionR3trans –d

If R3trans –d does not give a 0 return code it will be impossible to start SAP correctly.

Start SAPStart SAP for the post-copy steps.

C. Post-Copy Steps

TransactionInstruction
SLICENSE (Install the license for TEST)Click Install -> Enter system number and key (You can get this from SAP Service Marketplace.)

SLICENSE

RZ10 (Delete old profiles and Import existing profiles)Choose the profiles of the PRODUCTION server Profile -> Delete -> All versions -> of a profile

Do this for all PRODUCTION profiles.

RZ10

Then, import the correct profiles.

Utilities -> Import profiles -> Of active servers

RZ10-2

STMS (Create the appropriate system layout)Delete the current transport routes and then create a new transport route by choosing the appropriate structure for your systems (Three systems in a group, Single system, etc.).

STMS

BDLS (Change Logical System Name)Enter the old logical system name.

Enter the new logical system name.

Uncheck ‘TEST Run’ and ‘Check existence of new names in tables’.

Execute.

SE16 (Delete from tables)Delete all entries from the following tables: ALCONSEG, ALSYSTEMS, DBSNP, MONI, OSMON, PHAI, SDBAD, SDBAH, SDBAP, SDBAR, DDLOG, TLOCK.

Enter the table name -> Enter

Click Execute.

Choose all entries and delete.

SE38 (to delete old and cancelled batch jobs)Run program RSBTCDEL.

Choose * for job name and user name.

Choose ‘X’ for released, finished, cancelled, and delete with forced mode.

SE38

SE38-2

SPAD (Convert all printers to TEST)Utilities -> For output devices à Assign server

A list will display.

Enter the TEST spool server and choose Display List.

Convert all to the TEST server.

SPAD

SPAD-2

SM59 (Adjusting RFCs)Check and adjust the appropriate RFC destinations form PRODUCTION to TEST.
SM58 (Clean the transactional RFC)Open the date range.

Enter * for the user name -> Execute

SM58

Delete all Errors

SM58-2

SECSTORE (Change the secstore)Go to tab ‘System Data Changed’.

Enter the system number and Migration key (from SolMan).

Execute.

SECSTORE

RZ04 (Change OpModes)Remove old OpModes and create the new ones.

Double click on the OpMode.

RZ04

Delete the current distribution of work processes.

RZ04-2

Goto Settings -> Based on current status -> Existing instances -> Set

RZ04-3

SMLG (Logon Groups)Check the logon groups and delete the PRODUCTION logon groups and create the TEST logon groups.

SMLG

SMLG-2

SM13 (Delete Updates)Delete old update requests.

SM13

SM13-2

SM12 (Delete Locks)Delete old lock requests.
SM21 (Review System Log)Check system log for any errors.

SM21

SM21-2

SPAD (Cleanup Spool)SPAD -> Administration -> Cleanup Spool

Click all spool requests -> Continue

SPAD-Cleanup

SPAD (Spool Consistency)SPAD -> Administration -> Check Consistency -> Delete all errors

SPAD-Consistency

SWU3 (Restart Workflow)SWU3 -> Red beach ball icon

Not all will activate, but that’s okay.

SWU3

SM51 (Server Check)Make sure all servers show up and are available.

SM51

SCC4 (Client Settings)Make sure the client settings are correct.
SE06 (Change Settings)Make sure Change Settings are correct.

SE06

SE06-2

STMS (Catchup Transports)First, move the transports that went to TEST and not PRODUCTION. Next, move the transports that went into PRODUCTION after the freeze date / time.
SGEN (Regeneration of programs)Choose ‘Regenerate Existing Loads’

Execute in background (This will run for a long time. It is okay to continue to work in the TEST system, however it will be slow as the regeneration takes a lot of resources).

This step is necessary for regeneration of SAP program(s).

SGEN

6 Responses to "How to Do SAP System Copy? – A Step-by-Step Guide"
  1. MM says:

    there are many steps missing!

    • Patrick says:

      It is not possible to mention each and every step because many of them are specific to a particular situation. Which missing steps do you mean?

  2. fernando says:

    is not better put all steps and to do a complete cheklist, please complete because is so interesting

  3. Himanshu says:

    is it possible that structure of table/DSO/datasource etc can also be copied apart from the data?

  4. Julian Serna says:

    Nice post, thanks a lot!

    Leonid

  5. imran khan says:

    NIce document and user friendly!!!

Leave a Reply

Your email address will not be published. Required fields are marked *