Best practice for SQL maintenance and backups for GP clients

November 5, 2021

Best practice for SQL maintenance and backups for GP clients

1.     Nightly backup 

o   Schedule daily at midnight

o   Only Full backup and Maintenance clean up task selected

o   Only user databases are selected

o   Maintenance clean up pointed to the backup folder, file extension bak and to include first-level subfolders. Usually set up for 2 weeks. 

GP Maintenance Cleanup Task


2.     Transaction Log backup             

o   Make sure all GP databases are set up Full recovery mode (database properties, options, recovery mode) 

o   Create transaction logs as Daily, most common approach is to do either every 15 min or 1 hour depending on client’s needs and capabilities of the server and only during business hours

GP Transaction Log backup

 

3. Select only Backup Transaction Log and Maintenance Task


Maintenance Plan Wizard


Select All databases  (this list will only include database that are set up to have full recovery mode)


4.     Point Maintenance Clean up to backup folder, enter TRN for file extension and select to Include first-level subfolders



5.     Most common approach is to set to delete files every 2 days.

GP define maintenance cleanup task


System Database backup

-        Schedule it weekly over the weekend

-        Select only Full backup and Maintenance Cleanup Task

-        Select System database

-        Point Maintenance Cleanup Task to backup folder

-        Enter file extension bak

-        Mark to include first-level subfolders

-        Delete files every 2-4 weeks 


Database maintenance plan 

-        Schedule it weekly after nightly backup (for example Saturday at 2am) 

-        Select:

o   Check Database Integrity 

o   Reorganize Index

o   Rebuild Index

o   Update Statistics


Do not include backup. The idea is to recover to midnight backup in case something goes wrong with maintenance plan. 


GP select maintenance tasks


Select all user databases and accept the defaults. You can exclude individual DBs if needed. 

 

Note: If you do not select to make a backup to include first-level sub folders, the clean up maintenance will fail. 

 

Other SQL best practices:

Make sure that SQL memory allocation is capped at 80% of server memory

Make sure that owner for Dynamics and other GP companies is DYNSA

Make sure that SQL version for each individual DB reflects correct Compatibility Level


For clients with many GP companies use for example:

sp_msforeachdb ' USE [?] IF ''?'' <> ''master'' AND ''?'' <> ''model'' AND ''?'' <> ''msdb'' AND ''?'' <> ''tempdb''

 BEGIN  ALTER  DATABASE [?] SET COMPATIBILITY_LEVEL = 130; END 


ERP evaluation with a solution architect
By Marlena Stark July 26, 2026
Why you should not settle for endless sales calls with people who will never touch your system. The value of meeting the architects and implementers who will build your future.
By Marlena Stark June 16, 2026
Most Microsoft Dynamics consulting firms tell you what you want to hear. Dexpro tells you what you need to hear. Learn what sets us apart from other Dynamics 365 partners.
Smiling on bridge
By Marlena Stark May 26, 2026
Still on Dynamics GP? Microsoft's Bridge to Cloud 3 promotion offers a 30% discount on Business Central licenses. Learn if your company qualifies.
By Marlena Stark November 24, 2025
Microsoft Dynamics GP Latest Updates
By Marlena Stark April 20, 2025
What do you need to stay on Microsoft Dynamics GP
By Pola . November 15, 2024
Microsoft Dynamics GP Latest Updates
Dexpro March Newsletter
By Marlena Stark March 18, 2024
Team expansion to support Dynamics 365 CRM, new Microsoft promotions, and more in the Dexpro March Newsletter.
Pitfalls of Patching and Over-Customization in D365 BC
By Marlena Stark March 8, 2024
Learn from the pitfalls of patching and over-customization in Dynamics 365 Business Central. Discover the consequences of choosing the wrong partner and diving into customization without a proper understanding of system architecture. Find out how Dexpro Dynamics offers tailored solutions, guiding you through successful ERP implementations and avoiding costly mistakes. Contact us today to build a solid foundation for your business.
February Newsletter
By Marlena Stark February 11, 2024
Transition from Dynamics GP to D365 Business Central, compare cloud scenarios, and more in the Dexpro February Newsletter.
Compare Cloud Scenarios
By Marlena Stark February 8, 2024
Discover the ultimate guide to cloud migration for Dynamics GP. Whether you're considering migrating to Azure or making the leap to Dynamics 365 BC, our comprehensive comparison provides invaluable insights to help you make an informed choice. From cost considerations to functionality and scalability, we cover it all, ensuring you're equipped with the knowledge needed to optimize your ERP solution.