Walkthrough: Reclaim space and shrink the Transaction logs after Major Code Moves in Dynamics AX

Walkthrough: Reclaim space and shrink the Transaction logs after Major Code Moves in Dynamics AX

Sometimes, the simplest mistakes are also the most common ones. Something, that many people forget is to shrink the transaction logs after a model store code move. See, what happens is that code moves are very intense on the transaction logs. The transaction logs then grow to ridiculous sizes (many, many Gigabytes) and eventually the server runs out of space – even if a company is in simple mode or truncating the transaction log on backup operations. Model Store moves that are unmanaged will eat huge amounts of wasted space. The way to handle this is so simple, it is crazy. Simply shrink the transaction logs and all will be good. Let’s see how to do this extremely easy but often forgotten operation.

  1. Shrinking the Transaction Logs
    1. Stop the AOS

    2. Do a plain old copy-only backup

    3. Change the database mode to Simple

    4. Through a script or by simply right-clicking in the GUI (here is the GUI approach), choose to “Shrink File“.

    5. Make sure that you choose the transaction log file and press okay. See the picture below for how this is done.

    6. Now, change the database mode back to Full for Production. All other environments should be left at simple.

Done!!!! Wow, that was easy.. But it is so often forgotten. If you see the size of your AX database growing to ridiculous sizes, make sure that you check this first. It will save you so many headaches – and yes, this should be a process after every modelstore export. I do it as a part of my code move process when running an implementation code deployment process.