自动备份Enterprise Architect数据

时间:2011-12-08 15:25:48

标签: database enterprise-architect

我们正在为我们的模型使用Enterprise Architect,它使用数据库来保存其所有数据。我们现在需要每天“转储”数据,以便我们可以将其存储在配置管理系统中。有一个简单的方法吗?

2 个答案:

答案 0 :(得分:2)

此处没有特定的内置功能。 EA有两个版本控制选项,但它们基于包,而不是整个项目。

(顺便说一句,建议不要将外部版本控制系统与数据库存储的EA项目结合使用,所以除非你完全确定你在做什么,否则不要从那条路径开始;而是使用EA的基线。 )

使用“项目转移”功能(在工具 - 数据管理下)可以轻松手动转储项目。这允许您将整个项目从数据库传输到.EAP文件(以及其他三个组合)。这个过程通常不到一分钟。

EA API(Project :: ProjectTransfer)中也提供了此功能,因此如果您想自动化它,您可以这样做。在之前的工作中,我设计并实现了一个版本控制解决方案,其中这是一个组件,所以它可以完成,甚至都不是那么难。

答案 1 :(得分:0)

这可能很旧,但要记录Geert Bellekens的VBScript的一些示例代码

sub main

Dim CurrentDate
Currentdate = Replace(Date, "/", "-") 

dim repository
dim projectInterface
set repository = CreateObject("EA.Repository")

Dim FileName
Filename = "EA_Export.eap"

dim LogFilePath
LogFilePath = "C:\EA\EA_to_EAP.log"

dim TargetFilePath
TargetFilePath = "C:\EA\EA_Export.eap"

dim eapString
eapString = "EAConnectString:DB_EA_PROD --- DBType=1;Connect=Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DB_EA_PROD;Data Source=BESQLCP;LazyLoad=1;"

'get project interface
set projectInterface = repository.GetProjectInterface()

projectInterface.ProjectTransfer eapString, TargetFilePath, LogFilePath

'repository.CloseFile
repository.Exit 

Dim newFilename 
newFilename = "C:\EA\EAP_Files\EA_Export_" & CurrentDate & ".eap"

Dim Fso
Set Fso = WScript.CreateObject("Scripting.FileSystemObject")
Fso.MoveFile "C:\EA\EA_Export.eap", newFileName

end sub

main

参考:http://sparxsystems.com/forums/smf/index.php/topic,37635.msg235329.html#msg235329