How to do automatic backups of your Navision (native) database with the Navision Server

Article ID: 861749 - View products that this article applies to.
Expand all | Collapse all

TechKnowledge Content

Issue

How to do automatic backups of your Navision (native) database with the Navision Server?

Resolution

With Navision Version 3.x, a new server based backup (Hotcopy) was introduced. Hotcopy.exe installs automatically into the Navision Server folder. It works by reading out a snapshot of the database into a copy of the database. This means, that Hotcopy can be used without taking Navision off-line, even though it is recommended for performance reasons to schedule Hotcopy to run during off-peak hours. Hotcopy is documented in the w1w1bkup.pdf document on the product (3.70) CD.

The rest of this article describes another way of running unattended backups: Stopping the Navision Server, copying the database file(s), and then re-starting Navision Server. The recommended way of making unattended backups is to use Hotcopy as described above, but the alternative method described below has some advantages, that will make it preferable. This method may be slightly quicker than Hotcopy on very large databases, and it has the advantage that you can zip the backup file(s) as part of the schedule. The disadvantage is that the Navision Server has to be stopped during the backup.

If you do not perform backups using the Navision Financials backup utility (Tools | Backup) you should:

1. Perform a database test (at least the minimum) to ensure an uncorrupted database.

2. Stop the Navision Financials server during the backup to ensure that the database is the latest version.

You can schedule the activity on the Windows Server where you run your Navision server.
Assume that we have three database parts on drives D:, E:, and F: called DB1.FDB, DB2.FDB and DB3.FDB. The servername is NAVSERV. We can perform the following operations:

1. Stop the Navision server service.

2. Copy the database parts to drives G:, H:, and I:.

3. Perform a database test on both the live database and the copy.

4. Start the Navision server service.

5. Perform a tape backup of the database copy.

The batch file executing this may look like this:

NET STOP NAVSERV
COPY D:\DB1.FDB G:\DB1.FDB /B /V
COPY E:\DB2.FDB H:\DB2.FDB /B /V
COPY F:\DB3.FDB I:\DB3.FDB /B /V
FIN ID=TEST1,DATABASE=D:\DB1.FDB+E:\DB2.FDB+F:\DB3.FDB,COMPANY=,DBTEST=MIN
FIN ID=TEST2,DATABASE=G:\DB1.FDB+H:\DB2.FDB+I:\DB3.FDB,COMPANY=,DBTEST=MIN
NET START NAVSERV

Notes

1. All these activities must be scheduled to finish before tape backup starts.

2. The COMPANY parameter without specifying the Company Name will not attempt to log in to the system as user (no user logging screen).

3. Set up this scheduled task to be Interactive. If any of the tests fail, the server service will not be started. A supervisor needs to investigate at which stage the backup failed.

4. Perform a zip (compress) of the copy of the database parts so that you only put smaller files on your backup tape.

5. Exclude the live database parts from the list of files to be backed up to tape.

6. By stopping the Navision Financials server during the backup, you avoid the following side-effect; the database attributes may change during backup or the database file(s) may be affected in other ways, hence when the first user logs in, it may take a long time to start because the database engine will check the list of free blocks in the database.

7. You can log date and times during the batch.

Here is an more advanced sample of a backup batch:

echo ---------------------------------------------------- >> c:\fin\backup\backup.log
DATE /T >> c:\fin\backup\backup.log
TIME /T >> c:\fin\backup\backup.log

echo Stop the server service >> c:\fin\backup\backup.log
net stop finserv >> c:\fin\backup\backup.log
TIME /T >> c:\fin\backup\backup.log

echo Copy live database to backup >> c:\fin\backup\backup.log
copy /b d:\fin\database.fdb c:\fin\backup\database.fdb /v >> c:\fin\backup\backup.log
TIME /T >> c:\fin\backup\backup.log

echo Test live database >> c:\fin\backup\backup.log
c:\fin\backup\client\fin id=c:\fin\backup\backup1,nettype=tcp,temppath=%temp%,database=d:\fin\database.fdb,company=,dbtest=min
TIME /T >> c:\fin\backup\backup.log

echo Test backup database >> c:\fin\backup\backup.log
c:\fin\backup\client\fin id=c:\fin\backup\backup2,nettype=tcp,temppath=%temp%,database=c:\fin\backup\database.fdb,company=,dbtest=min
TIME /T >> c:\fin\backup\backup.log

echo ZIP backup database >> c:\fin\backup\backup.log
C:\Util\PKZIP -m -ex C:\fin\Backup\dbzip C:\fin\Backup\database.fdb
TIME /T >> c:\fin\backup\backup.log

echo Copy ZIP to file server >> c:\fin\backup\backup.log
copy C:\fin\Backup\dbzip.zip \\PDC\Backup /v >> c:\fin\backup\backup.log
TIME /T >> c:\fin\backup\backup.log

echo Start the server service >> c:\fin\backup\backup.log
net start finserv >> c:\fin\backup\backup.log
TIME /T >> c:\fin\backup\backup.log
echo --------------------------------------------------- >> c:\fin\backup\backup.log
exit

Here is a sample of the resulting log file:

Fri 07/05/1999
22:00
Stop the server service
The Financials Server FINSERV service is stopping.
The Financials Server FINSERV service was stopped successfully.

22:00
Copy live database to backup
1 file(s) copied.
22:03
Test live database
22:30
Test backup database
22:34
ZIP backup database
22:41
Copy ZIP to file server
1 file(s) copied.
22:42
Start the server service
The Financials Server FINSERV service is starting.
The Financials Server FINSERV service was started successfully.


22:42
---------------------------------------------------
---------------------------------------------------
Mon 10/05/1999
22:00
Stop the server service
The Financials Server FINSERV service is stopping.
The Financials Server FINSERV service was stopped successfully.


22:00
Copy live database to backup
1 file(s) copied.
22:03
Test live database
22:07
Test backup database
22:38
ZIP backup database
22:45
Copy ZIP to file server
1 file(s) copied.
22:46
Start the server service
The Financials Server FINSERV service is starting.
The Financials Server FINSERV service was started successfully.

22:46
---------------------------------------------------

Keyword: HotCopy



This article was TechKnowledge Document ID: 33361

Properties

Article ID: 861749 - Last Review: July 15, 2011 - Revision: 2.0
APPLIES TO
  • Microsoft Business Solutions–Navision 3.70
Keywords: 
kbmbsdatabaseandplatforms kbmbsmigrate KB861749
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com