These are the steps that should be followed prior to stopping your AOS service. These steps insure assemblies are properly updated.
Before stopping your AOS service you should go to System administration > Online users > Server instances tab and reject new clients on all your server instances.
This well send a message out to any logged-on user and notifying them that "The administrator is shutting down the Application Object Server. You must save your work and log off. If your user session is idle, you will be logged off automatically."
Monitor the Online users still connected through the Client sessions tab. Once you see all the users have logged of, proceed to the next step. Allow 5min for the message to pop up for the users. If you see some sessions have not ended after 15min, you can end them manually by placing a check mark next to the user name on the right and clicking End sessions. You can also select all by placing a check mark in the top box.
Withhold specific batch jobs that might run during the maintenance period. Not all batch jobs need to be turned off. Example of a batch job that should be turned off is Invoicing batch. If you turn of the batch AOS server during the execution of an invoice batch, the job will error out and some invoices might not print out or get emailed to customers. Or duplicate invoicing can occur. Once servers are back up you can put these jobs into Waiting status and it will run the missed schedule and then put it back on schedule for the next run.
Now you can stop your AOS Service.
DEV:
Keep in mind that in DEV you might installing models from ISV's & VAR's as well as maintaining CUS version.
- Stop AOS Service
- Backup Data Base in SQL Management Studio CopyOnly (Be descriptive on naming the backup )
- Run Dynamics AX Management Shell with elevated rights and run Install-model command (after model is installed check to make sure in went in ok optional. Run Get-axmodel command in MS Dynamics Management Shell)
- Run Build (Check the Log to make sure no errors)
- Start AOS Service
- Run full CIL (Make sure no errors)
- Restart AOS Service
- Run Data Dictionary Sync
- Restart AOS Service
- Restart SQL Reporting Service on AOS
- Change Model Version (for CUS layer)
- Export model (for CUS Layer)
TEST:
TEST should look just like prod except for its setting on a smaller hardware scale and settings are pointing to test servers instead on prod. This is where the code is completely test.
- Stop AOS Service
- Stop Management Reporter Service (Application & Process)
- Stop ISV application Services
- Backup Data Base in SQL Management Studio (Be descriptive on naming the backup)
- Run Dynamics AX Management Shell with elevated rights and run Install-model command (after model is installed check to make sure in went in ok optional. Run Get-axmodel command in MS Dynamics Management Shell)
- Run Build (Check the Log to make sure no errors)
- Start AOS Service
- Run full CIL (Make sure no errors)
- Restart AOS Service
- Run Data Dictionary Sync
- Publish Reports if there is any modification in reports (if there is a lot of reports run publish-axreport command in MS Dynamics Management Shell. If there are only a few then just deploy through AOT)
- Deploy Web Controls or Web Parts (if there are any)
- Restart AOS Service
- Restart SQL Reporting Service
- Start Management Reporter Service (Application & Process)
- Start ISV Application Services
- Restart IIS (If any Web Controls or Web Parts were deployed)
STAGING:
- Stop AOS Service
- Backup Data Base in SQL Management Studio (Be descriptive on naming the backup)
- Restore Gold from Prod
- Run Dynamics AX Management Shell with elevated rights and run Install-model command (after model is installed check to make sure in went in ok optional. Run Get-axmodel command in MS Dynamics Management Shell)
- Run Build (Check the Log to make sure no errors)
- Start AOS Service
- Run full CIL (Make sure no errors)
- Restart AOS Service
- Run Data Dictionary Sync
- Publish Reports if there is any modification in reports (if there is a lot of reports run publish-axreport command in MS Dynamics Management Shell. If there are only a few then just deploy through AOT)
- Restart AOS Service
- Export Model Store
PROD:
These steps are if you decide on not using the alternate schema.
- Stop all scheduled batch jobs that might be effect by AOS restarts (For example: Invoice batch jobs)
- Stop AOS Service
- Stop Management Reporter Service (Application & Process)
- Stop ISV Application Services
- Backup Database in SQL Management Studio (Be descriptive on naming the backup)
- Import AX Model Store (optional, but strongly recommended, In the PROD environment, create an alternate schema to import the model store, this is to avoid directly updating the active schema, thus saving you 30min of time)
- Start AOS Service
- Run Data Dictionary Sync
- Publish Reports if there is any modification in reports (if there is a lot of reports run publish-axreport command in MS Dynamics Power Shell. If there are only a few then just deploy through AOT)
- Restart AOS Service
- Restart SQL Reporting Service
- Start Management Reporter Service (Application & Process)
- Start ISV Application Services
- Deploy Web Controls or Web Parts (if there are any)
- Restart IIS (If any Web Controls or Web Parts were deployed)
- Start all scheduled batch jobs that were withheld earlier
- Log off users that have open sessions on RDS/Citrix
PROD:
These steps are if you decide to use the alternate schema.
- import the model store into the alternate schema
- Once you are ready to take down PROD
- Stop all scheduled batch jobs that might be effect by AOS restarts (For example: Invoice batch jobs)
- Stop AOS service
- Stop Management Reporter Service (Application & Process)
- Stop ISV Application Services
- Backup Database in SQL Management Studio (Be descriptive on naming the backup)
- Swap the imported modelstore into the active schema (this process takes seconds to complete)
- Start AOS service
- Run Data Dictionary Sync
- Publish Reports if there is any modification in reports (if there is a lot of reports run publish-axreport command in MS Dynamics Power Shell. If there are only a few then just deploy through AOT)
- Restart AOS
- Restart SQL Reporting Service
- Start Management Reporter Service (Application & Process)
- Start ISV Application Services
- Deploy Web Controls or Web Parts (if there are any)
- Restart IIS (If any Web Controls or Web Parts were deployed)
- Start all scheduled batch jobs that were withheld earlier
- Log off users that have open sessions on RDS/Citrix
For additional information on how to and some commonly used commands see links below.
Deploying Customizations and Solutions by using Models and the Model Store [AX 2012]
https://msdn.microsoft.com/en-us/library/hh335181.aspx
AxBuild.exe for Parallel Compile on AOS of X++ to p-code [AX 2012]
https://msdn.microsoft.com/en-us/library/dn528954.aspx
AX 2012 Code Promotion & Environment Refresh
*This post is locked for comments