Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 9 of 9 total
Thread Export/Import Users?
Fri, Mar 1 2019 1:59 AMPermanent Link

Ian Branch

Avatar

Hi Team,
EDB 2.30b5
I am setting up a number of Users with roles for a database on my Dev PC.
When I have finished this particular line of Dev I would like to be able to export the Users/Roles from my config and import them into my Customer's config.
Is this possible?
If so, how please?
Regards & TIA,
Ian
Fri, Mar 1 2019 2:39 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


Export is easy - something like

export table configuration.users to "userinfo.xml" in store buTfR FORMAT XML

Import isn't. The equivalent import statement is

import table configuration.users from "userinfo.xml" in store junk FORMAT XML

Try it and you'll get

ElevateDB Error #200 This operation cannot be performed on the system table Users in the schema Default or any privileges granted to it

This, in my opinion is "A GOOD THING"

What you could do is export the users and create a small utility to read in the file (or put it in a stringlist in code) and create the users with that.


OTOH someone may know a better way.


Roy Lambert
Fri, Mar 1 2019 3:49 AMPermanent Link

Ian Branch

Avatar

Hmm.  Thanks Roy.  A Start.
Where is the SQL History kept?  All the sql is in there, if I can recover that then do a Script...
Fri, Mar 1 2019 5:33 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


In Explorer | SQL History

Roy Lambert
Fri, Mar 1 2019 8:59 PMPermanent Link

Ian Branch

Avatar

Hi Roy,

>>In Explorer | SQL History

Yes, but I seemingly only accessible one sql instruction at a time.
Any way to export the history?

Ian
Sat, Mar 2 2019 3:28 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


You can always have a look in edbmgr.ini. However much history is stored is in there

By the time you manage to do something the easy way you'd have been able to do it 10 times the hard way Smiley

You may get away with just copying the config file and slapping that into your customers site, and then again you may not. I've never tried it so I can't say. If there's not to much user data involved you could always export that, dump their current system, replace with a blank version of your's with the users & roles and then import the data.

Unless someone out there has already written a utility to do it and will share you're better off just writing a small one to do this for you.

If you want to send me the config & catalog with logon info I'll knock one up for you - but be warned it will take me a couple of weeks because I'm deep in the middle of something.

Roy Lambert
Sat, Mar 2 2019 4:15 AMPermanent Link

Ian Branch

Avatar

Hi Roy,
Thanks for the offer.
I did it manually. Smile
Regards,
Ian
Tue, Mar 5 2019 11:48 AMPermanent Link

Adam Brett

Orixa Systems

Roy & Ian,

Another option would be to import the Users XML as a "normal" database table, then write a stored procedure to iterate this table and EXECUTE IMMEDIATE statements to CREATE USER.

It would not be trivial ... but not a horrible big job either.
Wed, Mar 6 2019 2:34 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam

>Another option would be to import the Users XML as a "normal" database table, then write a stored procedure to iterate this table and EXECUTE IMMEDIATE statements to CREATE USER.
>
>It would not be trivial ... but not a horrible big job either.

That's essentially what I would have done if Ian had accepted my offer.

Roy
Image