Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macola ES copy company

Status
Not open for further replies.

user35

MIS
Jun 26, 2007
29
0
0
US
Have a Macola ES question. If I want to create a new test company by copying my production company to a new company, ES still shows the original company number in the screen headers within ES? It shows the correct company when entering ES, but once I'm in it still shows the old company.

I created the company by creating a blank company within ES, then restoring my production company thru SQL Server to the test blank company. After I restore, my company data is back to the original company. What am I doing wrong?
 
This is because the company # itself is stored in the database itself all over the place in an ES database.

There is a SQL script that will find and replace the company # in the database, you will have to get this from Exact or your business partner.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
I certainly would like to see that script if someone could provide a copy.

I routinely take a copy of my primary database (Company 100) and make a TEST copy (Company 199). I do understand the problem as described. I caution my people and ensure they are very aware of when they are in TEST or Production.

What we do is the following:

On the 'fresh' test company, in System, Company Settings I rename the company to "*** 199 TEST *** Aug 8, 2007"

Secondly I ensure that the display on the status bar (lower left of the screen) is set to "Database + Company Name"

The top of the screen will still show 100, but the reference on the lower left correctly identifies the TEST environment. Another benefit is that most reports will display the company name which will correctly identify the TEST data.

Please let me know if you find the SQL Script.

Regards,

Jay
 
I asked around. Was told script was problematic...and could not find one that anyone would support...
 
I've been told the same thing by Exact i.e. they use to have a script, but they no longer make it available (no real reason given).

I tried doing this myself once as I have a Crystal report that shows every table a field exists in - I created the script and ran it but the company still showed the wrong number so I gave up at that point. It's just data, so you would think Exact would be able to provide this type of functionality, or even make it an option on the Macola ES 'create company' screen. The copy function that currently exists doesn't bring over much in the way of tables/data.

Peter Shirley
 
For what is worth :

The following is a script which I schedule as a DTS package at a few clients to nightly backup their primary ES company and restore it to an existing test company. As it is a test company, changing the company number everwhere is not done.

Exact does embed the company number in the GBKMUT, BankTransactions, CICMPY among other places. If you want to consolidate data across companies then chaning the company number in these tables becomes important. Gives you a refernce as to which company the data is coming from and deals with duplicate Debitor / Creditor Number across multiple databases.

I only change the company name in the Bedryf table, which is displayed on the login screen, and reports.

You may need to adjust the Physical file names, Logical File Names, directories, and paths.

Script :

--Makes sure that current DB is not 199
Use Master

--Backs up 100 to a file
BACKUP DATABASE [100] TO DISK = N'C:\backup.bak' WITH INIT , NOUNLOAD , NAME = N'100 backup', NOSKIP , STATS = 10, NOFORMAT

--Inorder to restore, changes target to single user mode
ALTER DATABASE [199] SET SINGLE_USER WITH ROLLBACK IMMEDIATE

--Restores database 100 to database 199
RESTORE DATABASE [100] FROM DISK = N'C:\backup.bak' WITH FILE = 1, NOUNLOAD , STATS = 10, RECOVERY , REPLACE , MOVE N'100_Data' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\199_Data.MDF', MOVE N'199_Log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\199_Log.LDF'

--Changes the Logical File Name in SQL
USE "199"
GO
ALTER DATABASE [199]
MODIFY FILE
(NAME = '100_Data', NEWNAME='199_Data')
GO

--Switches the database back to multi user mode
ALTER DATABASE "199" SET MULTI_USER WITH ROLLBACK IMMEDIATE

--Deletes the Backup File
exec master.dbo.xp_cmdshell "del c:\backup.bak"

--Updates the Company Name in Macola ES
use [199]
update bedryf set bedrnm = '"*** 199 TEST ***' + CAST(GETDATE() AS nvarchar(30))

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top