Import CSV Members

  • Andrew Hicks
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 10 months ago #82082 by Andrew Hicks
Import CSV Members was created by Andrew Hicks
We have a couple of problems with importing membership data:
1. If we re-import data then each member gets duplicated with a new entry, even if each entry is matched against an existing Joomla user. Is there any way we can avoid this - just overwrite / update the existing data?
2. Status is always set to 'pending' when we import members, even if we have a field called 'status' that is set to 'Active', as per the sampple CSV file generated by the system.
3. is there any way we can import Membership IDs. We tried with a field called 'membership ID' and one called 'ID' but the system ignores these.

Please Log in or Create an account to join the conversation.

  • Andrew Hicks
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 10 months ago #82087 by Andrew Hicks
Replied by Andrew Hicks on topic Import CSV Members
OK we fixed the status set as 'active' issue - that now works.
Also we got 'membership_id' to work (it was turned off in cofiguration) so members can now be imported with their legacy membership ids and automatically set as active.

However repeat uploads are still resulting in duplicated entries - even with the same membership ID and username. Please help us to set it so that existing data - based on membership_id - is updated during imports, rather than always added to.

That way we will be able to add and populate additional fields of data using import, not just for the first upload and without having to delete the previous entries of the entire membership each time. This would be very helpful. Thank you very much.

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #82119 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Import CSV Members
Hi Andrew

If you repeating the upload and don't change any of the below information, then the records should be added, it will be added instead:

- email
- from_date
- to_date

Could you please check? Maybe you changed one of the above information and that's the reason causing the issue?

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Andrew Hicks
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 10 months ago #82125 by Andrew Hicks
Replied by Andrew Hicks on topic Import CSV Members
Hi Tuan,

Thanks for the quick response! Yes that worked. I added columns for from_date and to_date with the format "yyyy-mm-dd hh:mm:ss" as per the csv download and subscribers display and that worked perfectly!

Thanks very much!

Andrew

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #82138 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Import CSV Members
Great. Thanks for confirming Andrew

Tuan

Please Log in or Create an account to join the conversation.

  • Andrew Hicks
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 10 months ago #82152 by Andrew Hicks
Replied by Andrew Hicks on topic Import CSV Members
Actually there is still a problem, Tuan.

I attach the file of import data. If we import it - it imports fine. If we re-import it then still it is fine. Members are not duplicated.

However if we click on a members name, after importing, and then 'save and close' - without making any changes - that is also fine (no duplication).

If we then re-import the data then any member that has been edited now gets a duplicated record.

ie 1. Import, 2. edit member (and save) then 3. re-import => duplicated entry for any edited member.

So some other timestamp is changing when we save after edit.

Please Log in or Create an account to join the conversation.

  • Andrew Hicks
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 10 months ago #82154 by Andrew Hicks
Replied by Andrew Hicks on topic Import CSV Members
Part of the problem here lies with the members list.
When subscriber records get duplicated then the Members List always continues to display the first data it finds for each subscriber, which is the original entry, while all new data gets imported into the new duplicated entry.
Unless the system administrator is aware that there is a duplicated entry then this can become a problem as only the old data is displayed.
We think it would be better if the Members List displayed the last (most recent / highest ID) data for a subscriber rather than the earliest. That way if duplications occur they do not matter so much because the system always uses the most up-to-date version.

Please Log in or Create an account to join the conversation.

  • Andrew Hicks
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 10 months ago #82155 by Andrew Hicks
Replied by Andrew Hicks on topic Import CSV Members
There is a further problem in the case of duplicated subscriptions.
We created a duplicated subscription, as per above, and then deleted the earlier entry but retained the duplicate.
In this case the person is no longer displayed in the members list.
Also in the subscribers list they do not appear.
But in the subscription list everything appears correct.
So we edited that entry and then saved it, without changing anything.
Not it appears in the list of subscribers, but with empty plan subscribed to - ie no subscription.
They still do not appear in the members list.
Yes in the subscription list everything still appears correct - plan subscribed to, etc.
Quite clearly the duplicated record is causing a problem with the data, with some underlying data links being retained with the original entry and others with the duplicate entry.
Deleting the original does not help, it makes things worse.
The only solution is to delete everything and re-import the whole lot.
You can test this using the book1.csv that I attached earlier. I have repeated this process several times, based on these instructions, and get the same result every time.
So it is a system bug rather than data error (although probably caused by data error in the import file).

Please Log in or Create an account to join the conversation.

  • Andrew Hicks
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 10 months ago #82158 by Andrew Hicks
Replied by Andrew Hicks on topic Import CSV Members
Another minor problem to do with importing csv data. This time we fixed it ourselves.

I don't know if this is identified elsewhere in your forum or online documentation, but thought it might help to share the experience:

We imported our membership from a csv file and found that 13 members (out of 250) loaded as subscribers but failed to create joomla ids.

On examination of the csv data we found three causes for this:
1. trailing space after the user name
2. trailing space after the email address
3. spaces within the email address

Once we fixed these problems all 13 re-imported correctly, using a csv file with only those 13 members in it, so as to avoid accidentally duplicating any others. We were careful to delete the original imported record first, to avoid the duplication issue described above.

This is really a problem for users but may we make two suggestions:
1. It would be helpful if the documentation explained this problem, so people know to look for it (just for these two columns, plus 'password' column if used) and
2. The import software could automatically strip out any spaces found in these three fields - which would fix the problem by compensating for careless users.

Thanks and regards,
Andrew

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #82168 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Import CSV Members
OK Andrew. Thanks for sharing the experience. Yes, I will update the code to stripe out space characters automatically during the import to avoid such errors like that

Tuan
The following user(s) said Thank You: Brian Shea

Please Log in or Create an account to join the conversation.