LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Backup Citadel 5 Databases

Hi,

the new Citadel 5 Databases gives me a problem for my backup strategy. As we store our data in databases per "experiment set up", I have to backup more than one database (probably) and I do want to process this automatically.

With Citadel 4 this was quite easy. I wrote an LabVIEW DSC application which scanned a directory tree for databases and made an backup of this one to an identical tree inside a backup directory tree.

But as I'm must experience right now with the Citadel 5 archive VIs it's not possible to give a path to an database, I have to use an URL instead.

So my questions are:
* How can I get the URLs of all databases on one computer?
* Can I get the location of a database? (The backup should have the same name, j
ust in another location and the exclusion should be done by this location.)
* Or is there a tool from NI for doing a backup (not included into another k� package)?

Stopping the database and copying the files to another location is no option, because I don't want to loose the data of the experiment that might be running.

Thanks,
Carsten
0 Kudos
Message 1 of 9
(4,733 Views)
If you just want to backup the databases, one solution would be to search your directory tree for directories that contain files with the file extensions used for databases and then just use the 'Copy' function from the File I/O>>Advanced palette to backup the files. From your descriptions that should do the trick and it would be pretty simple.

Regards,
JR A.
Application Engineer
National Instruments
Message 2 of 9
(4,733 Views)
OK, that's a possibility for databases not actually written to. But what to do with an active database? The copied version might end up corrupted, doesn't it?

Cheers,
Carsten
0 Kudos
Message 3 of 9
(4,733 Views)
I just ran a quick test and found that you can input a directory path to where the Citadel 5 database is for the URL. It was then able to open all of the traces in the database. So your previous method should still work.

Regards,

JR A.
0 Kudos
Message 4 of 9
(4,733 Views)
Oh, I did try this with the "Archive Traces.vi" and got errors. Maybe it's been a mistake of mine -- I'll test it the next days again.
0 Kudos
Message 5 of 9
(4,733 Views)
Hi,

Archive Traces.vi doesn't like pathes for me. It wants an URL always.

I found another aproach. In lvdsc\historical\cittools.llb I there is CTL_listDBNames&Path.vi. With this VI I can get all attached databases it seems. Only these database could be active and need to be copied by Archive Traces.vi. For all other databases in my tree a normal file copy should be sufficient.

I can't use CTL_listDBNames&Path.vi exclusively because a user might have detached a database of which a backup is needed...

Carsten
0 Kudos
Message 6 of 9
(4,733 Views)
I took a look at this and it appears that the Achive Traces.vi doesn't like the destination URL as a path but will allow a source URL to be a directory path. So if you use Create Database.vi to create the database and then the Archive Traces.vi to move the traces from the old to new database it should work. Attached is a simple test VI I used.

JR A.
0 Kudos
Message 7 of 9
(4,733 Views)
I was slightly mistaken in my last post. Actually, you can use a path instead of a URL if the database is already added to the Citadel 5 Universe in MAX. However, if you just copy over a database from another computer it won't be added to the Universe. However, you can use the Create Database.vi to attach and existing database directory to the Citadel 5 Universe. Attached is a revised example that will work even if the original database has not been attached to the Citadel 5 Universe.
0 Kudos
Message 8 of 9
(4,733 Views)
Hi,

thanks very much for all your tests :-))

It works fine -- almost. One problem remains if the database is attached but has a different name than the one derived from the path automatically. Then "Create Database.vi" will return an error. If the names are the same all works fine.

So I suppose I still need to test whether the database is attached or not because normally our attached databases won't have the names derived from the path.

A nice feature for DSC would be to store the name in some attributes of the database and reuse it by default if the database is attached and this name doesn't exist on the system yet.

Thanks for all your help.

Cheers,
Carsten
0 Kudos
Message 9 of 9
(4,733 Views)