Restore GP backup in different company

Question Status

Unanswered
Restore MS Dynamics GP 10 backup asked a question on 13 Sep 2017 4:27 AM

Hi Team,

i was having 2 MS Dynamics GP 10 servers for 2 different companies, one of this companies stop using GP from 2011 , now they want some old data .

Can i restore backup in different company name and different server  means i want to make in one GP Server 2 companies , they need it only for history. 

regards

Saleem

Reply
Bill Campbell responded on 13 Sep 2017 8:51 AM

Hello, first a couple of questions.

1. is the old company data the same version as the current installed companies?

2. can you create a new company database on the server?

BIll

Reply
Alvaro Rodriguez responded on 13 Sep 2017 12:06 PM

Short answer: Yes you can

Long answer:

* first as Bill mentioned, you have to have the same version on both the old server and the new one GP and SQL server.

* Create a new company.

* Restore a backup from the old server to the new company DB you created

* run the following script to change the COMPANYID and INTERIDfrom the old one to the new one:

if exists (select 1 from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'SY00100') begin
  declare @Statement varchar(850)
  select @Statement = 'declare @cStatement varchar(255)
declare G_cursor CURSOR for
select case when UPPER(a.COLUMN_NAME) in (''COMPANYID'',''CMPANYID'')
  then ''update ''+a.TABLE_NAME+'' set ''+a.COLUMN_NAME+'' = ''+ cast(b.CMPANYID as char(3)) 
  else ''update ''+a.TABLE_NAME+'' set ''+a.COLUMN_NAME+'' = ''''''+ db_name()+'''''''' end
from INFORMATION_SCHEMA.COLUMNS a, '+rtrim(DBNAME)+'.dbo.SY01500 b
  where UPPER(a.COLUMN_NAME) in (''COMPANYID'',''CMPANYID'',''INTERID'',''DB_NAME'',''DBNAME'')
    and b.INTERID = db_name() and COLUMN_DEFAULT is not null
 and rtrim(a.TABLE_NAME)+''-''+rtrim(a.COLUMN_NAME) <> ''SY00100-DBNAME''
  order by a.TABLE_NAME
set nocount on
OPEN G_cursor
FETCH NEXT FROM G_cursor INTO @cStatement
WHILE (@@FETCH_STATUS <> -1)
begin
  exec (@cStatement)
  FETCH NEXT FROM G_cursor INTO @cStatement
end
close G_cursor
DEALLOCATE G_cursor
set nocount off'
  from SY00100
  exec (@Statement)
end
else begin
  declare @cStatement varchar(255)
  declare G_cursor CURSOR for
  select case when UPPER(a.COLUMN_NAME) in ('COMPANYID','CMPANYID')
    then 'update '+a.TABLE_NAME+' set '+a.COLUMN_NAME+' = '+ cast(b.CMPANYID as char(3)) 
    else 'update '+a.TABLE_NAME+' set '+a.COLUMN_NAME+' = '''+ db_name()+'''' end
  from INFORMATION_SCHEMA.COLUMNS a, DYNAMICS.dbo.SY01500 b
    where UPPER(a.COLUMN_NAME) in ('COMPANYID','CMPANYID','INTERID','DB_NAME','DBNAME')
      and b.INTERID = db_name() and COLUMN_DEFAULT is not null
    order by a.TABLE_NAME
  set nocount on
  OPEN G_cursor
  FETCH NEXT FROM G_cursor INTO @cStatement
  WHILE (@@FETCH_STATUS <> -1)
  begin
    exec (@cStatement)
    FETCH NEXT FROM G_cursor INTO @cStatement
  end
  close G_cursor
  DEALLOCATE G_cursor
  set nocount off
end

I don't see why it would be any different than creating a test company, but be sure that both servers are on the same version of GP with the same modules installed and same SQL server and collation (this last one I'm not sure if it will affect)
Regards, hope this helps.
Reply
Leslie Vail responded on 13 Sep 2017 5:02 PM

I'd also like to add that both companies need to have the same account framework. You mentioned you had two installations, they both need to have the same account framework.

Kind regards,

Leslie

Reply