NAV – Native database to SQL Migration

One of them that effect most of the customer is Support to NATIVE Database. So today we will discuss about Native to SQL Migration which is one of the steps during upgrade to NAV 2013.

Let’s See why we cannot restore a backup of Native Database into SQL Server Database.

For Demo Purpose i have taken a demo database and intentionally created some issues which normally occurs during SQL Migration.

So i have NAV 2009 SP1 Native DB with Errors. I took NAV backup and trying to restore same on SQL Server NAV 2009 SP1 Database.

Here is the error message that i get –

The Cust. Ledger Entry table contains a field with a date value that cannot be used with SQL Server:
Record: Entry No.=’1820′
Field: Posting Date=’01-01-0101′ (WHICH I CHANGED intentionally)

Reason –
SQL Date Starts From 01-01-1754.

*There are other errors too during restoring Native Backup to SQL.

Resolution-

We will follow the procedure given by Microsoft.

For this you will require Product DVD & Developer Licensce.

1) Navigate to Upgrade Toolkit ->SQL Migration in Product DVD.

2) you will find Migrate.fob.

3) Import Migrate.fob in Native Database(10 objects will be imported).

4) Run Codeunit 104010 Create Field Checking Code (This will create a text file in C Drive named as FIELDCHK.TXT.

5) If you are using windows 7 and the codeunit gives you an error message saying – “The operating system cannot access to the file C:\FIELDCHK.TXT .Verify that the file type and attributes are correct”.

Then design the codeunit and onRun Trigger change the Path of the File Name to some other drive.

6) A message will popup which confirm that file is created.

7) Import the txt file into the database. (you require Developer Licensce to do that).

8) After importing compile Codeunit 104015 Field Check. After compilation Run Codeunit 104015 Field Check.

9) This process will take time as per the size of your database and no. of companies in your database.

10) The will will keep you updated about number of errors that have been found yet.

11) Once completed it will display a message with count of total number of errors.

12) Once clicked OK a form will get open which will contain the incorrect value and suggested values from tool.

13) You can change the New value as per discussion with client.

14) After doing all rectification just click ESC and the message will confirm that you want to update the new values in tables.

15) Delete all records from table 104010 Incorrect Data Value & 104011 Code Field Information FROM ALL COMPANIES.

16) If selected yes the new values will be applied.

17) After completion mark Codeunit 104015 and then filter based on version @*MIG* and mark all listed records.

18) Remove the filter and select all marked objects.

19) Delete all objects(Total object count should be 10).

20) Take Navision backup and restore on SQL Server Database.

 

Taken from: http://saurav-nav.blogspot.si/2012/12/nav-2013-upgrade-part-iv-sql-migration.html

Advertisements

How to migrate data between DPM disks

MigrateDatasourceDataFromDPM is a command-line script that lets you migrate DPM data for a data source  (e.g. replica volumes and recovery point volumes) across disks. Such a migration might be necessary when your disk is full and cannot expand, your disk is due for replacement, or disk errors show up.

Depending on how you have configured your environment, this could mean one or more of the following scenarios for moving data source data:

  1. DPM disk to DPM disk
  2. Data source to DPM disk
  3. Data source to custom volume

DPM disk to DPM disk Migration

When I migrate DPM disk to DPM disk, I received errors mentioning there wasn’t enough disk space. After research and reference I found out it is because of the data sources I used span across multiple disks. The best explanation for this behaviour I found was located in this article: Space needed to migrate a disk.  More detailed information on DPM disk to DPM disk migration can be found in the following article: How to Use The Migratedatasourcedatafromdpm.Ps1 DPM Powershell Script to Move Data.

Data Source to DPM Disk Migration

I want to emphasize the second scenario (Data Source to DPM Disk) for which I wasn’t able to find many relevant articles. When I used this option had a few issues.

From the articles mentioned above, these were outlined as the required steps: the first 3 lines set the variables required for the migrateddatasourcedatafromdpm script, as follows:

  • $PG is the protection group available in your DPM.
  • $DS are the data sources
  • $disk is the disk available on the server.

Please take note that the first disk is $disk[0]. The first protection group is $pg[0] and first data source is $ds[0]

$pg = Get-ProtectionGroup DPMTestServer 
$ds = Get-Datasource $pg[0] 
$disk = Get-DPMDisk –DPMServerName DPMTestServer

The following step is the script which runs the migration of data source (no 1) to disk assign (disk no 2):

./MigrateDatasourceDataFromDPM.ps1 –DPMServerName DPMTestServer –Source $ds[0] –Destination $disk[2]

If you have multiple data sources in one protection group, then change the value [0] to [1] and so on.

Here’s a screen shot of a sample DPMDisk output:

Screen shot of a sample DPMDisk output

Once the script has finished executing, you’ll need to run consistency check. This is expected as there have been changes made to the volume, and these will need to be re-synchronized by running a synchronization job with consistency checking.

 

Taken from: http://blogs.technet.com/b/mspfe/archive/2011/06/08/how_2d00_to_2d00_migrate_2d00_data_2d00_protection_2d00_manager_2d00_resources_2d00_to_2d00_a_2d00_new_2d00_storage_2d00_location.aspx