Importing existing user data..

12 years 6 months ago #180232 by Yaun
Importing existing user data.. was created by Yaun
Hello,

I have an existing member management application (handles eVoting and will handle member finances) with about 500 user records.

Using a common schema pattern, this application can co-exist with CB, but only if I can import/migrate the existing records into CB / Joomla.

What is the current (Joomla 1.7 and CB 1.7) schema for user records? Assume the default, after using the CB tools to create example fields.

I've examined the database and it seems that (excluding the j17_ prefix) the following tables are involved:
a) [comprofiler] keeps the CB field values,
b) [comprofiler_fields] and [comprofiler_field_values] keeps the CB field definitions and values.
c) [users] keeps the Joomla field, and needs to be synchronised with (a). Usertype field must be synchronised with:
d) [usergroups]

I assume that [users] is required for authentication.

Thus, importing the data will require creating rows in:
[users] and [comprofiler]
with the appropriate user "level", based on ACL, in [users.usertype], comes from [usergroups.title] ?

I do need to change the default usergroups..

Once the records have been imported, CB can possibly be left to manage the records only if I can ensure that change-tracking is enabled, and that business rules are adhered to.
I think "CB Profilebook Module" might be able to perform change-tracking.
The other business rules are mostly related to promotions and member sign on...

Please Log in to join the conversation.

12 years 6 months ago - 12 years 6 months ago #180236 by krileon
Replied by krileon on topic Re: Importing existing user data..
To import users properly into a CB installation you should use CB Juice, which you can find more information on at the below forums.

www.joomlapolis.com/forum/226-cb-juice

I do not recommend direct database additions unless you're absolutely sure you know and understand how Joomla and CB database functions. Massive problems can occur if ACL is not handled properly. CB Juice uses API to handle user import so everything is done properly and safely.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

12 years 6 months ago - 12 years 6 months ago #180375 by Yaun
Replied by Yaun on topic Re: Importing existing user data..
CBJuice will certainly help with an initial import.

However, I still have complex workflow requirements that will require *runtime* access by another (Java-based) application, running on the same server.

Is there (for example) a REST (or JSON) interface, similar to CBJuice?

If not, where is the up-to-date database schema of CB 1.7 fully described?

Reading cbapi_0.006.pdf I see that it might be possible to write an appropriate PHP interface class (Snoopy.class.php sounds interesting) to grant the Java application access to the CB backend..

A little searching coughed up this link on a REST API for Joomla .

I guess I am after something like:

Create/Update/List/Delete users with Jomsocial support
Create/Update/List/Delete Jomsocial groups
Create/Update/List/Delete Jomsocial group discussions, announcements and wall posts
Create/Update/List/Delete Jomsocial events
Create content
List categories/sections

but for CB instead of Jomsocial. Actually, a simple:

Create/Update/List/Delete CB Profiles

would be sufficient.

Please Log in to join the conversation.

12 years 6 months ago #180413 by Yaun
Replied by Yaun on topic Re: Importing existing user data..
Ok - looking at the REST example "user_list.php", which has to be edited slightly before it works (as does "server/includes/framework.php"), I can query the standard Joomla! users table (using database queries).

But I want to edit the CB users tables. The real solution, then, is to use CB API calls, instead, yes?

Where do I find a document describing the CB API to:
*) list user(s) (with filters),
*) update an existing user?
*) create users (optional),
with examples.

Is it really just "cbapi_0.006.pdf" ?

Or must I reverse engineer the CB Juice plugin?

Please Log in to join the conversation.

12 years 6 months ago #180484 by krileon
Replied by krileon on topic Re: Importing existing user data..
CB doesn't have a REST API (nor does CB Juice that I am aware of). You'll need to use Joomlas but edit it to use CB API. You can find information on including CB API and registering users at Tutorials within my signature.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: Yaun

Please Log in to join the conversation.

12 years 6 months ago #180493 by Yaun
Replied by Yaun on topic Re: Importing existing user data..
Thanks - your tutorial looks like it is quite simple to create a user by CB API.

It still *appears* to be doing direct database stuff - does the technique outlined there also manage ACL assignment/memberships?

Probably using "usertype", I guess.

Does the standard "Registered\|Voting Member" work, if I need to add multiple user groups? ("Registered" is a bad example to use in a tutorial, as it is both a user group AND an access level).

The "Establish $user object" tutorial, I assume, is the integer database ID in jos_comprofiler.user_id (which is equivalent to jos_users.id)?

All things considered, it could be relatively easy to integrate a new plugin with the "REST API for Joomla", above, and perform the tasks I need via REST.

PS: In your "create-users-through-api" tutorial, the link embedded in "To create a user you must first Include API externally if you are creating..." does not work.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.194 seconds

Facebook Twitter LinkedIn