Cannot Export Membership Subscription dates in correct format

  • David Unwin
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 3 months ago #155655 by David Unwin
We are in the process of moving our site to Joomla 4.
We are now trying to export our Membership Pro subscriptions from Joomla 3 to Joomla 4 
The problem we have is that when we export from Joomla 3 site the dates do not get exported in the format YY-MM-DD HH-MM-SS which required for the import so we can't then import them to Joomla 4 site because of the date format.
See the screen shot of the file and the error message
I can't see any way to change the format of the date on export.
Any ideas
 
 
 

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

  • David Unwin
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 3 months ago #155657 by David Unwin
I think the only way to do this is with PHPMyAdmin rather than the Membership Pro export function as that exports the dates as text . Export table prefix_osmembership_subscribers . You can define the exported table as a CSV or Excel file for the import. 

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

  • David Unwin
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 3 months ago - 2 years 3 months ago #155659 by David Unwin
I think I have discovered another problem which prevents export/import  to another version of membership pro.
The import function as I see it relies on the file to be imported having the 'Joomla User name' of the person with the membership to link it to the Joomla User.
The Membership Pro export does not export the 'Joomla user Name' only the email address.
The PHPMYAdmin Export exports the Joomla User ID but not the User Name. 
So with both of these exports we can't the link the membership subscription records to a user. 
see example screen shots from joomla export and phpMyAdmin
Both of them export the email address of the user, but I don't think the import will link the membership subscription records by email address. 
Am I right?    
Regards
David
Last edit: 2 years 3 months ago by David Unwin. Reason: Add screen shots

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

More
2 years 3 months ago #155666 by Tuan Pham Ngoc
Hi David

Go tp Membership Pro -> Configuration, look at Export Settings tab, you can choose to Export User ID, Export Username.... from there and it should address your issue

Tuan

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

  • David Unwin
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 3 months ago #155670 by David Unwin
Hi Tuan,
Thanks for information about exporting the username.
However,  I still have the original problem  The Membership Pro export function exports date time fields such as created date as text ie '17th September 2022 16:33;30' not as 'yy-mm-dd hh:mm:ss' which is required by the Membership Pro import function. So when I try an import I get the message 'created_date not a correct date value'.
See my original message screen shot.
Kind regards
David
 

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

More
2 years 3 months ago #155676 by Tuan Pham Ngoc
Hello

For export, it uses the format from Date Format config option. So in this case, before exporting, you can go to Membership Pro -> Configuration, change Date Format to Y-m-d and it should address the issue.

Regards,

Tuan

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

  • David Unwin
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 3 months ago #155682 by David Unwin
Hi Tuan,
Thanks for the update.
I have now changed the export to Y-m-d for the datetime fields I am importing. See screen shot. However I now get a message '0 strlen(): Argument #1 ($str) must be of type string, DateTime given' on the Import of the data See second screen shot. 
All the datetime fields look correct to me in the excel file being imported.
Any ideas on this?
Kind regards
David
 
Attachments:

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

More
2 years 3 months ago #155692 by Tuan Pham Ngoc
Could you please get this file, unzip it, upload the received file to administrator/components/com_osmembership/model folder, then check it again to see if it works?

Maybe you should make a full backup of your site database before running the import (or test on a test site), just in case anything is wrong, you can restore

 
Attachments:

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

  • David Unwin
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 3 months ago #155695 by David Unwin
Hi Tuan,
The updated import function worked ! Just some points of interest.
1. I ran another export on my Joomla 3 system. This time I forgot to drop the Joomla User id field from the exported fields. When I imported the subscriptions, the import matched subscriptions records against the User ids in the subscription record and the existing Joomla user ids in our Joomla 4 system, which for us was incorrect. The reason was that when we imported our users from Joomla 3 to Joomla 4 our users got allocated new user id's. Therefore the subscription records were matched to the wrong users. We then backed out the import changes. Then I dropped the column User id from the excel file and then did the re-import again. As there was not a Joomla User Id in the excel file, the import matched the Joomla User Name in the subscription record against the Joomla 4 User name, which is what we wanted. So it all worked fine. 
2. We also tried to import a couple of subscriptions where the plan name in the Joomla 3 system was not in the Joomla 4 system. The import displayed the error message, but did not indicate which plans had the error. However for us this was minor as we knew the plans in question.

Thanks for fixing this issue for us and I assume the updated import php will be in the next release of Membership Pro.

Kind regards
David

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

More
2 years 3 months ago #155717 by Tuan Pham Ngoc
Yes. The updated import will be included in next release of the extension. Don't worry.

Regards,

Tuan

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