How to take automated backup from Microsoft Dynamics Nav 2009 classic databases?

Hi All,

Please tell me how to take the automated backup from Microsoft Dynamics Nav 2009 Classic database(basis on scheduled time).Are there any third party software’s to do this.Is it possible to take the automated backup?.

Thanks & Regards,

Baba Guru.

Hi,

You can check at mibuso.com. I found at that forum. If I not mistaken no third party software for auto backup.

Regards,

Look at this link

http://www.expandit.com/templates/expandit.asp?catalog_id=616

A standard solution for Native-database is HotCopy, which may run via Windows’ Scheduled Tasks.

Look into NAV documentation to learn how to set it up. [;)]

And there are numerous discussions here in Dynamics User Group and Mibuso.

Hi.

A simple way to automate backups and is very reliable, is using AutoHotkey (open source free application). It is far better than Hotcopy backup which does not understand the state of the database. I use Nav 2009, classic fbk database.

I’ve attached the script file (autohotkey) and the batchfile that I created.

The bat file is called zip.bat to agree with the file in the script, obviously you can call it what you like so long as you change the script as well

You can convert this script to an executable with Autohotkey so it runs nicely with task manager. on any Server or PC, I have run it with Win 7 and XP

What it does:

The script/Executable starts your Nav application, uses the tabs and keystrokes that you would normally enter yourself and then kicks off the backup, once saved it then call a batchfile to rename compress, and copy the file to another location (I do this because the nav backup for me is around 2.5gb - compressed it is down to about 130mb. I test quite frequently and have not had an issue in 2 years.

Because I backup over 2gb I end up with 2 files to compress and copy but if you had 3 or four or more you just need to duplicate the lines in the batchfile with a rename of the file in each duplicate section.

Be aware: If you are using your desktop and another program is in the foreground when the taskmanager starts then, the script will attempt to operate on it instead of opening Nav . (I just kick it of manually from the executable in my 7Z-NAV folder)

You will be warned for 30 seconds that the backup is about to start

You can copy and paste the script below to configure it for your environment, it looks a bit daunting if you don’t do this kind of stuff but I assure you it is all very easy. I’m sure there is a scripter out there who can improve on my effort.

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.

SendMode Input ; Recommended for new scripts due to its superior speed and reliability.

SetWorkingDir c:\7z-NAV ; Ensures a consistent starting directory.

MsgBox , NAV Backup, Backup Process will start in 30 seconds, 30

FileDelete, d:\NAV\NAV-Daily.* ;Deletes file(s) created for last backup

run, "C:\Program Files (x86)\Microsoft Dynamics NAV\60\Classic\fin.exe"

WinWaitActive, Techsil-Microsoft Dynamics NAV Classic, , 2 ;Wait for main Window to open

sleep 1000

send !F b O

sleep 400

send {Enter}

sleep 400

Send !F m O

sleep 400

send {Enter}

sleep 400

send !W A

sleep 1000

send !t b ;Keystrokes = ALT Tools > Backup

SetMouseDelay, 2000

WinWaitActive, Backup, , 2 ;Wait for Backup Window to open

Send {Tab 2}

Send {Enter} ;Backup should start at this point

Send {Enter}

Send {Enter}

WinWait, Microsoft Dynamics NAV Classic

WinWaitClose ;Wait for the backup window to close

sleep 1000

send !W A

sleep 1000

send !f x ;Keystrokes=Alt File > Exit

sleep 1000

runwait zip.bat

The batch file that is called is below, it copies and compresses and attaches a date. you will see that it is duplicated because I have two two files created by NAV so they are named slightly differently.

Rem Tasks below are scheduled through “TASK SCHEDULER” and runs

Rem once every week day after the NAV backup at 16:25

7za a -t7z “x:\NAV Backups\NAVarchive.7z” “d:\NAV\NAV-Daily.fbk” -r -mx7 -mmt x=7 s=500f200m -wx:\tempzip

Set FileDate=%date:/=%

ren “x:\NAV Backups\NAVarchive.7z” NAVarchive%FileDate%.7z

7za a -t7z “x:\NAV Backups\NAVarchive2.7z” “d:\NAV\NAV-Daily2.fbk” -r -mx7 -mmt x=7 s=500f200m -wx:\tempzip

Set FileDate=%date:/=%

ren “x:\NAV Backups\NAVarchive2.7z” NAVarchive2–%FileDate%.7z