1. Make sure that your current hardware supports Windows server 2012 as per the MS recommendation.
Important: Make sure that the replication between all your DC are working properly, else you will fails to complete the below operations.
2. Before performing the upgrade, you must prepare your forest and domain for the changes. It can be achieved by using the command 'ADPREP'. ADPREP is a command line utility which will extends the Active Directory schema, and updates permissions as necessary to prepare a forest and domain for a domain controller. In order to run the commands you must locate it from your server installation CD. Insert your Windows server 2012 installation CD and locate the directory using command prompt. In my case the installation CD is located in D drive and command will be cd D:\support\adprep press ENTER or open the directory and drag and drop the tool adprep from the location(D:\support\adprep) into command prompt.
a) Now run this command in your forest root server and prepare the forest for upgrade.
adprep /forestprep press ENTER. You will have warning message before this operation, type C and press ENTER to continue with the operation( You must be a member Schema Admins and Enterprise Admins groups to perform this action)
Once the operation is completed you will have the below screen.
b) Now prepare your domain for upgrade. On the same command prompt type adprep /domainprep and press ENTER. This operation will complete comparatively faster than the forest preparation.
More information of using the ADPREP is available in http://technet.microsoft.com/en-in/library/dd464018(v=ws.10).aspx
3. Replicate these changes to your additional domain controllers as well. On command prompt type RepAdmin /SyncAll and press ENTER. Wait few seconds to complete and make sure succeeds.
4. Completing the above steps makes your server to be capable for upgrade. Now reboot your server from Windows server 2012 installation CD or open the CD drive and double click on SETUP.EXE to start with OS installation/upgrade.
5. Click on Install now and continue.
6. Here you need to specify either you want to perform a windows update before upgrade process or not. It is
recommended to perform windows update before upgrade process, else you can skip this. I have my latest update installed so skipping this operation by selecting No Thanks.
7. Enter the product key and click Next to continue.
8. Select the operating system that you want to install and click Next. Note that you will not be able to upgrade from a lower edition to higher edition of OS. Means, if you have windows server 2008 R2 standard edition installed then you will not be able to upgrade to Datacenter edition of 2012. Here my existing server is datacenter edition so I will select as Windows server 2012 datacenter(Server with GUI).
9. Accept the License terms and click Next.
10. Next step actually determines whether it’s an installation or Upgrade. Click Upgrade: Install windows and keep files, settings and application.
11. Now it will perform a compatibility check and this must be passed in order to continue. If it detects any applications to be uninstalled or any other changes requires it will show and you need to exit and make the necessary changes.
Note: Upgrade process will fail if we need to make any changes before upgrade and it can be viewed on Compatibility report window. Also the report will be saved automatically on your desktop for you reference.
Assuming everything is OK and click Next to continue,
12. The upgrade process will start and we need to wait until the operation completes. The server will restart multiple times during this process.
13. Now that’s it the upgrade process. Please note that this may take few hours to complete based on the features and application that is already existing on your server. For me it has taken about 1.5 hours to complete this operation but again it depends on your hardware efficiency. Please note that during the automatic reboot of your server it will prompt with Windows boot manager, you do not want to interrupt the operation and it will continue automatically.