Author Topic: Importing 13k users from old shop to Virtuemart  (Read 4402 times)

Acardenes

  • Beginner
  • *
  • Posts: 29
Importing 13k users from old shop to Virtuemart
« on: September 14, 2011, 10:14:17 am »
Hi, as stated in the title, I need to import into Virtuemart a number of users. Problem is, the old shop is an old php custom scrip (as far as i know, it could be a well know ancient scrip modified by the original programmer or totally written by him...)

I have this colums in my db:

Code: [Select]
ID, name, lastname, deliveryadddress, postalcode, provinceID, province_delivery, countryID, billing_address, phone, email, password, newsletter, date_creation, date_last, sent
I guess I could just import username, password and email address and have the customer add his delivery after first buy in the shop, but the password is gonna be a serious problem, am I right?

Well, I wonder if this task could be done or I will need to ask the customers to register again.

Any ideas?

stinga

  • Contributing Developer
  • Full Member
  • *
  • Posts: 872
    • Squangle ltd
Re: Importing 13k users from old shop to Virtuemart
« Reply #1 on: September 15, 2011, 09:05:54 am »
G'day,

Depends on how the password is stored, would need a bit more information.
But it would be a simple job to load the data into J!/VM, just need to work out the password issue, is it the same can it be decoded etc.
If it can't just set it to a known value and the cust will have to use the remind me button.
You could send all your customers an email to say they need to change their password due to you moving the shop to a newer patform.

Quite a common issue really.
Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

Acardenes

  • Beginner
  • *
  • Posts: 29
Re: Importing 13k users from old shop to Virtuemart
« Reply #2 on: September 15, 2011, 09:46:51 am »
Hi Stinga, thanks for your reply. The function that generates the passwords in the old page is using 
Code: [Select]
substr(md5(rand()),0,6); for the passwords, but it's no so important.
I'll be happy if they are created in Virtuemart and I have to send an email asking them to get a new password  :)

Could you point me at the right direction?

Thanks!

stinga

  • Contributing Developer
  • Full Member
  • *
  • Posts: 872
    • Squangle ltd
Re: Importing 13k users from old shop to Virtuemart
« Reply #3 on: September 15, 2011, 20:11:25 pm »
Not sure if VM uses the same method, if it does then you are in luck, otherwise just do the remind me method.

Next thing then is to have a look at the tables and see how they are populated. The easy method to do this is to take a system where there is no activity, no other users etc. Turn on mysql logging and add a customer this will give the tables that need to be populated. I did this for product entry, takes too long to use the gui, so I created a cli load_prd.pl program to populate the DB. Much faster.

show tables like '%use%';
gives
Code: [Select]

+---------------------------+
| Tables_in_joomlat (%use%) |
+---------------------------+
| j_users                   |
| j_vm_auth_user_group      |
| j_vm_auth_user_vendor     |
| j_vm_order_user_info      |
| j_vm_user_info            |
| j_vm_userfield            |
| j_vm_userfield_values     |
| j_wats_users              |
+---------------------------+

So that is a good place to start :-) Won't need all those tables, just need to work out what ones you need to populate.
Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

911websiterepair

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 253
  • We Can Do It!!
    • Virtuemart Programming and Customization Help - C H E A P !!!
  • Skype Name: mjones1256
Re: Importing 13k users from old shop to Virtuemart
« Reply #4 on: September 15, 2011, 21:30:07 pm »
you can get the users,   but not their passwords
joomla components, modules and extensions @ http://www.madeforjoomla.com
joomla development, customizations and repair spemildts, http://www.911websiterepair.com

Virtuemart 2.0 PayPalPro Module
Virtuemart 2.0 Fedex Shipping Module
Virtuemart 2.0 Express Order Module
Virtuemart 2.0 Authorize.net SIM payment module
http://www.VirtuemartMailOrderManager.com

stinga

  • Contributing Developer
  • Full Member
  • *
  • Posts: 872
    • Squangle ltd
Re: Importing 13k users from old shop to Virtuemart
« Reply #5 on: September 16, 2011, 00:38:33 am »
G'day,

I think you will be able to use the existing passwords if you change the encryption method to md5 (this might be the default), which is what you already have.

Register a user and have a look at the password, then use the md5 statement to generate one and compare, if joomla give the same result you are in luck, failing that change ./libraries/joomla/user/helper.php to do whatever you want it to do, I think the password stuff is rattling around in there some where.

@geekhead
Don't need the plain text password, the encrypted will do. He would only move that data so no need to try and decrypt it.
Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

dragos.alex

  • Beginner
  • *
  • Posts: 6
Re: Importing 13k users from old shop to Virtuemart
« Reply #6 on: September 16, 2011, 10:05:18 am »
it works also with plain passwords, just upload them, then:"UPDATE jos_users SET `password` = MD5(`password`) WHERE LENGTH(`password`) > 0 AND (LENGTH(`password`) != 65 AND LOCATE(':', `password`) != 33) AND LENGTH(`password`) != 32 ".
i did this for 900 users and it worked.

stinga

  • Contributing Developer
  • Full Member
  • *
  • Posts: 872
    • Squangle ltd
Re: Importing 13k users from old shop to Virtuemart
« Reply #7 on: September 16, 2011, 14:33:42 pm »
OP does not know the plain text passwords though.
Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

Acardenes

  • Beginner
  • *
  • Posts: 29
Re: Importing 13k users from old shop to Virtuemart
« Reply #8 on: September 16, 2011, 15:00:26 pm »
Yeah, I don't know the plain passwords. Anyway, thanks a lot for the answers, I will try to do a test import and see how it goes.

Thanks again!