MBH2006 Posted July 18, 2019 Report Share Posted July 18, 2019 What is the best way to move clients with existing services from cPanel to DA? I'm referring of course to the billing system itself and modifying current services to use the new module. Any ideas from Blesta power users would be much appreciated. Quote Link to comment Share on other sites More sharing options...
0 Nahuel Posted July 30, 2019 Report Share Posted July 30, 2019 Would love a reply for this. I have clients on an old cPanel server. I don't want to change everything, should be easy to point the services to the new server, right now I can't. Quote Link to comment Share on other sites More sharing options...
0 Tyson Posted July 30, 2019 Report Share Posted July 30, 2019 Moving between modules would require some manual updates. I'm not aware of a utility to map from cPanel or DA or vice-versa. You will need to make 2 primary changes: Update the service fields (`service_fields` table in the database) saved for the cPanel services to map them to DirectAdmin in Blesta. Alternatively, you can do step #2 first and then manage each service in the admin UI to add the appropriate fields for the service. cPanel fields include: cpanel_domain cpanel_username cpanel_password cpanel_confirm_password DirectAdmin fields include: direct_admin_domain direct_admin_username direct_admin_password direct_admin_email direct_admin_ip Based on that information, you will need to map the fields by renaming the `service_fields`.`key` of affected services to their DirectAdmin equivalent: cpanel_domain => direct_admin_domain cpanel_username => direct_admin_username cpanel_password => direct_admin_password cpanel_confirm_password can be deleted direct_admin_email should be added direct_admin_ip should be added Update any of those values as necessary (e.g. if the cPanel username is different now that it is on DirectAdmin, update the value for it). The password fields are encrypted, so you can update those through Blesta by managing the service in the admin UI if necessary. Update the module row for each affected service from the cPanel module to the DirectAdmin module Making this change will only affect Blesta. You will still need to move the service yourself from your cPanel account to your DirectAdmin account Assuming you are doing a one-to-one mapping (i.e. you have 1 cPanel module row and 1 DirectAdmin module row), you can update all module rows for all services in a query: UPDATE `services` SET `module_row_id` = DIRECT-ADMIN-MODULE-ROW-ID WHERE `module_row_id` = CPANEL-MODULE-ROW-ID; Replace those IDs with the appropriate module row IDs for those modules Michael 1 Quote Link to comment Share on other sites More sharing options...
0 PauloV Posted July 31, 2019 Report Share Posted July 31, 2019 @Tyson @MBH2006 @Nahuel Hello We have made some years in 2015 lol, long time ago a tool to map/move services from one module to outher in this case was moving from "Blesta Universal Module" to "OpenSRS Module" We only need the Services ID from Module A (cPanel) and Module B (Direct Admin) Here is the code exemple on the Plugin: public function install($plugin_id) { $sendreport = null; $module_A = array('1','2','3'); // put here the Service Package Id's from Module A $module_B = array('4','5','6'); // put here the Service Package Id's equivalent to Module A to migrate $module_migrate_map = array_map(null, $module_A, $module_B); foreach ($module_migrate_map as &$value) { $upackages = $this->Record->select(array("pricing_id","package_id"))->from("package_pricing")->where("package_pricing.package_id", "=", $value[0])->fetchAll(); $sendreport .= "Module A Package ID = ". $value[0]."\n"; foreach ($upackages as $upackage) { $upricings = $this->Record->select(array("id","period","term"))->from("pricings")->where("pricings.id", "=", $upackage->pricing_id)->fetchAll(); $sendreport .= "Module A Package Price ID = ". $upackage->pricing_id."\n"; foreach ($upricings as $upricing) { $gterm = $upricing->term; if ($upricing->period == "month") $gterm = ($upricing->term / 12); $sendreport .= "Module A Price Period = ". $upricing->period."\n"; $sendreport .= "Module A Package Price Term = ". $gterm." -> Original Term = ".$upricing->term." \n\n"; $sendreport .= "Module B Package ID = ". $value[1]."\n"; $opackages = $this->Record->select(array("pricing_id","package_id"))->from("package_pricing")->where("package_pricing.package_id", "=", $value[1])->fetchAll(); foreach ($opackages as $opackage) { $sendreport .= "Module B Price ID = ". $opackage->pricing_id."\n"; $opricings = $this->Record->select(array("id","period","term"))->from("pricings")->where("pricings.id", "=", $opackage->pricing_id)->where("pricings.period", "=", "year")->where("pricings.term", "=", $gterm)->fetchAll(); foreach ($opricings as $opricing) { $opricingid = $opricing->id; $sendreport .= "Module B Package Price Period = ". $opricing->period."\n"; $sendreport .= "Module B Package Price Term = ". $opricing->term."\n"; $sendreport .= "\n\n---------------BEGINING---------------\n"; $oservices = $this->Record->select(array("id"))->from("services")->where("pricing_id", "=", $upricing->id)->fetchAll(); foreach ($oservices as $oservice) { $sendreport .= "Migrate from A to B Imported Service ID = ". $oservice->id."\n"; $this->Record->where("pricing_id", "=", $upricing->id)->where("module_row_id", "=", "2")->update("services", array("pricing_id"=>$opricingid, "module_row_id"=>"3")); $this->Record->where("service_id", "=", $oservice->id)->where("key", "=", "user1")->update("service_fields", array("key"=>"domain")); $this->Record->from("service_fields")->where("service_id", "=", $oservice->id)->where("key", "in", array("opt1","opt2","pass","user2"))->delete(); } $sendreport .= "\n------------------END-------------------\n\n"; } } } } $sendreport .= "\n\n"; } mail("notify@mydomain.com", "Blesta - Migrate from Module A to Module B Report", $sendreport); } Hope this help someone Regards, PV Tyson, Blesta Addons and Michael 3 Quote Link to comment Share on other sites More sharing options...
0 Joseph H Posted September 10, 2019 Report Share Posted September 10, 2019 On 7/31/2019 at 2:57 AM, Tyson said: Moving between modules would require some manual updates. I'm not aware of a utility to map from cPanel or DA or vice-versa. You will need to make 2 primary changes: Update the service fields (`service_fields` table in the database) saved for the cPanel services to map them to DirectAdmin in Blesta. Alternatively, you can do step #2 first and then manage each service in the admin UI to add the appropriate fields for the service. cPanel fields include: cpanel_domain cpanel_username cpanel_password cpanel_confirm_password DirectAdmin fields include: direct_admin_domain direct_admin_username direct_admin_password direct_admin_email direct_admin_ip Based on that information, you will need to map the fields by renaming the `service_fields`.`key` of affected services to their DirectAdmin equivalent: cpanel_domain => direct_admin_domain cpanel_username => direct_admin_username cpanel_password => direct_admin_password cpanel_confirm_password can be deleted direct_admin_email should be added direct_admin_ip should be added Update any of those values as necessary (e.g. if the cPanel username is different now that it is on DirectAdmin, update the value for it). The password fields are encrypted, so you can update those through Blesta by managing the service in the admin UI if necessary. Update the module row for each affected service from the cPanel module to the DirectAdmin module Making this change will only affect Blesta. You will still need to move the service yourself from your cPanel account to your DirectAdmin account Assuming you are doing a one-to-one mapping (i.e. you have 1 cPanel module row and 1 DirectAdmin module row), you can update all module rows for all services in a query: UPDATE `services` SET `module_row_id` = DIRECT-ADMIN-MODULE-ROW-ID WHERE `module_row_id` = CPANEL-MODULE-ROW-ID; Replace those IDs with the appropriate module row IDs for those modules Hi, I managed to change all values ok. But adding "direct_admin_ip" does not seem to reflect in blesta. Can you please suggest a better way of adding the IP in bulk. Thanks Quote Link to comment Share on other sites More sharing options...
0 Tyson Posted September 10, 2019 Report Share Posted September 10, 2019 The direct_admin_ip field is expected to be set to what is stored in DirectAdmin. To update those in bulk, you would need to write a script to query Blesta for all DirectAdmin services, get their usernames from the service meta data, then fetch them from the DirectAdmin API using the CMD_API_SHOW_USER_CONFIG command by their username to retrieve information about the user, including the IP address. Then the script can update the service meta data in Blesta with an IP address for each user. Quote Link to comment Share on other sites More sharing options...
0 Kurogane Posted October 2, 2019 Report Share Posted October 2, 2019 In these days its possible to migrated more easy? Quote Link to comment Share on other sites More sharing options...
0 brixsat Posted February 7, 2020 Report Share Posted February 7, 2020 I would also appreciate a more easy migration. If not possible under what tables in db should i be looking? Thanks in advance Quote Link to comment Share on other sites More sharing options...
Question
MBH2006
What is the best way to move clients with existing services from cPanel to DA? I'm referring of course to the billing system itself and modifying current services to use the new module.
Any ideas from Blesta power users would be much appreciated.
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.