View Full Version : Is it possible to view import scripts in clear text?
eugenevdm
04-30-07, 04:14 PM
I having someone design an import routine for Plesk Clients & Domains.
Instead of reverse engineering the database and interacting directly with it, is it possible to view the import scripts, such as the Modernbill import script, in clear text?
At present it looks all garbled (Ioncubed?) and I'm sure it's probably intellectual property, but being able to see an example import script will save my developer quite a bit of time. It looks like an import will involve first creating a client, then an order, and then a product / domain.
skshost
04-30-07, 06:11 PM
I wouldn't bet on it.
An import script is made up of a ton of MySQL entries. Query...Import.. Update... It's not very complicated IMO, just time consuming. Your developer should know/understand that. Just looking at another import script would only give an idea of how to structure it. The real work is looking back and forth at database tables matching things up.
eugenevdm
04-30-07, 06:19 PM
Right but an existing script could give me some ideas on how the order numbers are generated and how the passwords are encrypted..
skshost
04-30-07, 06:41 PM
In most cases passwords are best encrypted using md5() with added salt. Can you be specific on the Import script you're looking for?.. Import from _____ to _____?
eugenevdm
05-01-07, 09:44 AM
I would like to import from Plesk 8.1.x Windows & Linux Clients and Domains to WHMCS 3.1.2.
Plesk Linux keeps it's clients in a table called 'clients'.
WHMCS keeps it's clients in a table called 'tblclients'
These fields correspond as follow:
Plesk Linux <-> WHMCS
------------ -----
id <-> id (auto increment)
cname <-> companyname
pname <-> firstname + lastname
login <-> in WHMCS your email is your login
account_id <-> no equivalent but needs to be used to extract clear text password from Plesk
phone <-> phonenumber
fax <-> does not exist, possible to add in custom fields (more later)
email <-> email
address <-> address1 + address2
city <-> city
state <-> state
pcode <-> postcode
country <-> country
Linked to 'accounts' <-> password (encrypted)
If you've added custom fields such as 'Fax' you have to examine 'tblcustomfields' and to obtain the relative IDs to the 'tblcustomfieldsvalues' and so obtain the values. At this stage I'll leave that to the brave.
Plesk for Windows has a slightly different layout, in that the password field isn't related to a different table, instead held in the 'clients' table in a field called 'passwd'.
When you talk about domains it gets more interesting.
Plesk domains are held in a table called 'domains' and linked to the 'clients' table by the 'cl_id' field.
Plesk domain limits are held in a table called 'Limits' and linked in the 'domains' table by the 'limits_id' field.
The reason why I mention limits is because at some stage during this conversion process I have to add new packages ('tblproducts') to WHMCS but before I can do that I have to hard code our Hosting packages to some of the existing limits as defined by Plesk. To give you an example, if the 'disk_space' limit is '209715200' and I'm currently migrating server 'Server29' I have assume it's a Silver Hosting package that normally comes with 200 MB disk space. Silver hosting packages must be hard coded to the correct ID in 'tblproducts'. This will work quite well on our system because on specific servers specific packages normally have set amounts of disk space. Where this won't work is when the web site was set up on Plesk without a template, or where the Plesk limit has been increased. But I suspect this will migrate about 90% of the sites just fine.
In order to migrate domains that don't have hosting I will look for a specific limits and instead of inserting into 'tblproducts' I have to insert into 'tbldomains'.
Once I've determined which package to assign it looks like I have to create an order in WHMCS in the 'tblorders' table. My actual objective is to create a new Hosting entity in the 'tblhosting' table, but since 'tblhosting' refers to orders I am going to create an order first. This is where the order number ('ordernum') comes in, I haven't worked out how it's generated but it looks fairly random.
At some stage I have to assign prices to hostings, this will also have to be some kind of a hard coded lookup.
I'm not really a developer but this is the brief I gave to my developer to far. If anyone has some constructive input please feel free to comment.
mediademon
07-03-08, 01:11 AM
Hiya
In a similar position (Plesk 8.3 on Windows) with a bunch of client accounts / domains to move to WHMCS.
Did you actually finish a script to do this?
Kind regards
Mediademon
mediademon
07-30-08, 08:28 AM
Hi
Doesn't matter, done it manually while waiting for a response...
tfn
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.