A strange error at the time of restoring the Backup

gdkve9gdkve9 Member Posts: 161
Hi all..

Hope everything is going well with everyone.

Here is one strange thing happening when I am trying to restore a backup. Its giving an error msg as shown in the attachement.

I am working on Nav 4.0 SP3 and
The backup was taken from the database which has got 3 companies.
but the backup contains only one company.

Hope someone might have come across the same problem and will share the reason for the cause.

Thanks all in advance :)
Dilip
Falling down is not a defeat..defeat is when you refuse to get up.

Comments

  • matttraxmatttrax Member Posts: 2,309
    The "already exists" in a standard NAV error message. The first part looks like a custom table. Not sure why it would appear in a backup/restore...unless maybe you're restoring into a database that already has data in it?
  • kinekine Member Posts: 12,562
    SQL or Native?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • gdkve9gdkve9 Member Posts: 161
    mattrax wrote:
    The first part looks like a custom table
    and yes you are absolutely right. Unit cost Recalculate is a custom table. But my doubt was why this error should get prompted at the time of backup restoration. And also I am trying to restore it on a newly created database.
    kine wrote:
    SQL or Native?
    I am trying to restore in a native database.
    Dilip
    Falling down is not a defeat..defeat is when you refuse to get up.
  • kinekine Member Posts: 12,562
    And origin of the database backup is SQL or Native?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • gdkve9gdkve9 Member Posts: 161
    Origin is SQL kine.. Is that creating the problem :-k
    If so how shall i proceed to resolve it :idea:
    Dilip
    Falling down is not a defeat..defeat is when you refuse to get up.
  • kinekine Member Posts: 12,562
    Problem is, that sometime SQL allows you to add things, which are not allowed in Native DB. Mostly because primary key is not CODE field but Text like in case of Post Codes. Upper and lower case characters are different for SQL but same for Native. You need to correct the data in SQL and than it should be restored in Native...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    I have seen this a number of times, but ONLY in SQL, and Always a collation error. You need to check if you have collation exactly the same on the machine you backed up from and the one you are restoring to.

    I have never seen this on Native.
    David Singleton
  • gdkve9gdkve9 Member Posts: 161
    kine wrote:
    Problem is, that sometime SQL allows you to add things, which are not allowed in Native DB. Mostly because primary key is not CODE field but Text like in case of Post Codes. Upper and lower case characters are different for SQL but same for Native. You need to correct the data in SQL and than it should be restored in Native...
    Is there any possiblity that rather correcting the data and restoring, if there is some means where I can bypass this table and make the backup get restored. As there are SQL restrictions on the user, data correction in the table is not possible.

    Would be appretiated if could mention some other idea :idea:

    Thanks...!!
    Dilip
    Falling down is not a defeat..defeat is when you refuse to get up.
  • DenSterDenSter Member Posts: 8,304
    Sounds to me like the one-company backup contains a record common to all companies that already exists in the database that you are restoring the company into.
  • kinekine Member Posts: 12,562
    DenSter wrote:
    Sounds to me like the one-company backup contains a record common to all companies that already exists in the database that you are restoring the company into.

    Than it will not restore data common for all companies, wouldn't it?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • gdkve9gdkve9 Member Posts: 161
    Sounds to me like the one-company backup contains a record common to all companies that already exists in the database that you are restoring the company into.

    I am trying to restore the backup in the clean database where no company exists. Its a newly created database.
    Dilip
    Falling down is not a defeat..defeat is when you refuse to get up.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    gdkve9 wrote:
    Sounds to me like the one-company backup contains a record common to all companies that already exists in the database that you are restoring the company into.

    I am trying to restore the backup in the clean database where no company exists. Its a newly created database.

    Restore to a SQL database with the same collation as the original.

    Why do you want to put it in Native?
    David Singleton
  • DenSterDenSter Member Posts: 8,304
    kine wrote:
    Than it will not restore data common for all companies, wouldn't it?
    Well it would try to restore data that is already there, and you get the error that records already exist.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    DenSter wrote:
    kine wrote:
    Than it will not restore data common for all companies, wouldn't it?
    Well it would try to restore data that is already there, and you get the error that records already exist.

    Actually I think Kamil is correct; when you open the restore dialog, the "Data common to all companies" field will be blank and greyed out so you can not select it.
    David Singleton
  • DenSterDenSter Member Posts: 8,304
    when you open the restore dialog, the "Data common to all companies" field will be blank and greyed out so you can not select it.
    When the backup includes common data, the option will be greyed out?
  • kinekine Member Posts: 12,562
    Yes, if you have already something in the DB, you cannot restore the data common to all companies (like users, roles etc..)

    As David wrote, the problem is collation or text primary key. I remember same situation with Post Code table, where two entries had same number and city name, different only in character case, when SQL was Case-sensitive. For SQL - it is two different values, for native, which is case-insensitive, only one same value...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • gdkve9gdkve9 Member Posts: 161
    Thank u all guys for sharing your valuable ideas.

    I was able to resolve the issue by changing the primary key in the table, took the backup again and was able to restore the same in the native database (Newly created one).

    Best Regards.
    Dilip
    Falling down is not a defeat..defeat is when you refuse to get up.
Sign In or Register to comment.