Jump to content

Whmcs Migrator (Beta) - Updated 2013-11-12


Cody

Recommended Posts

  • 3 weeks later...

We've gotten reports with clients having the same client number after importing clients. It's a bug in Blesta we're working to fix for 3.0.7

 

The solution for now is to change the 'clients_start' company setting to '1'. This bug occurs because the default starting value is '1500', but the maximum number of your imported clients is less than that.

Run the following query to find the 'clients_start' company setting:

SELECT * FROM company_settings WHERE key='clients_start';

Run this query to set the value to '1':
UPDATE company_settings SET value='1' WHERE key='clients_start';
Link to comment
Share on other sites

  • 1 month later...

So I gave it a go with 3.1-b2 importing 5.2.15 and it failed with

importPackages: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'term' in 'field list' on line 124
I've checked and "pricings" has a "term" column in Blesta, so not sure why this fails...

 

Here's the solution. In /plugins/import_manager/components/migrators/whmcs/whmcs_migrator.php change:

            if (version_compare(BLESTA_VERSION, "3.1.0", ">=")) {
To:

            if (version_compare(BLESTA_VERSION, "3.1.0-b1", ">=")) {
This fix will be included in 3.1.0 (CORE-969).

 

3.1.0-b1 set to 3.1.0-b2.

Link to comment
Share on other sites

We need more information.

 

What I can make from Facebook he is trying to import domains from WHM** to Blesta 3.0 and they don't get imported, I'm not sure if it's because he hasn't selected a registrar or if it's because he has over 500 domains.

 

Hope he doesn't mind me posting these from our Facebook page PM's.

 

1606828_1443914952489171_1801870332_o.jp

 

1552832_1443914985822501_1531305522_n.jp

Link to comment
Share on other sites

3.1.0-b1 set to 3.1.0-b2.

Did that and got a new error

importPackages: Undefined index: email on line 914

EDIT: That was because I had error reporting on.

 

Now I have this which prevents the script from completing the task

(
    [email] => Array
        (
            [format] => Please enter a valid email address.
        )

)

EDIT 2:

Only 1 domain got imported as a service

Transactions are not linked to invoices

Directadmin module shows 0 accounts linked to the server

Link to comment
Share on other sites

I gave it a go again, but still on b2...

  • Same error message from the importer
  • Some transactions are linked, so this seems to be working. The ones which are missing are probably too old and were not done in WHMCS
  • Still only 1 domain imported. Since there is no error log, I can't see what happened after that one.

EDIT: Same result on 3.1.0.

Domain packages are created, most are using the universal module due to all the missing registrars.

Most domains don't have an order id, so maybe that's the reason they're skipped.

Link to comment
Share on other sites

I have run into a problem with clients being in credit after a successful WHMCS import.

 

This seems to be due to invoices which have no transactions. In WHMCS the invoices are marked as paid but don't have a transaction attached to it. These are old invoices that were imported from ModernBill several years ago.

 

Any ideas how to resolve this?

Link to comment
Share on other sites

I have run into a problem with clients being in credit after a successful WHMCS import.

 

This seems to be due to invoices which have no transactions. In WHMCS the invoices are marked as paid but don't have a transaction attached to it. These are old invoices that were imported from ModernBill several years ago.

 

Any ideas how to resolve this?

 

You can un-apply credit given. On the transaction box on the clients, click on the transaction and you should see a unapply. Or you can simply mark them as void or error.

Link to comment
Share on other sites

You can un-apply credit given. On the transaction box on the clients, click on the transaction and you should see a unapply. Or you can simply mark them as void or error.

 

Unfortunately I don't have that option as Blesta thinks the transaction hasn't been applied to any invoices "This transaction has not been applied to any invoices.".

Link to comment
Share on other sites

I have run into a problem with clients being in credit after a successful WHMCS import.

 

This seems to be due to invoices which have no transactions. In WHMCS the invoices are marked as paid but don't have a transaction attached to it. These are old invoices that were imported from ModernBill several years ago.

 

Any ideas how to resolve this?

 

You can either apply payment to those invoices in WHMCS before importing, or after importing into Blesta simply record payment (credit) for each invoice that should be paid.

 

If neither of those solutions work for you, you could simply mark those invoices as paid by setting a date for their invoices.date_closed database setting. This requires making changes directly to the database, and is obviously not sound accounting, so I only recommend this if absolutely necessary.

Link to comment
Share on other sites

In the table 'tbldomains', there is an ID.  Under 'tblorders', there is a value in the column 'ordernum' for every domain.

They all have an id, but there is an orderid column and in my table it's set at 0 for most domains. I'm just wondering if you're seeing the same thing.

 

EDIT

I checked my tblorders and there is only one domain order, so if that's what Blesta is using, then I'll never get my domains, but your situation seems different as you have orders for your domains.

Link to comment
Share on other sites

Not sure.  I'm looking in the migrator files (whmcs_services.php) and I see this:

 

/**
     * Fetch all domain-name services
     *
     * @return PDOStatement
     */
    public function getDomains() {
        return $this->remote->select()->from("tbldomains")->getStatement();
    }

Link to comment
Share on other sites

Hello,

 

Any help to these:

 

The import completed but the following errors ocurred:
importContacts: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'client_id' cannot be null on line 124
importTaxes: There is already an active transaction on line 163
importCurrencies: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 124
importInvoices: There is already an active transaction on line 163
importTransactions: There is already an active transaction on line 163
importPackages: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 124
importServices: There is already an active transaction on line 163
importSupportDepartments: There is already an active transaction on line 163
importSupportTickets: There is already an active transaction on line 163
importMisc: There is already an active transaction on line 163

Thanks in advance

Link to comment
Share on other sites

 

Hello,

 

Any help to these:

 

The import completed but the following errors ocurred:
importContacts: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'client_id' cannot be null on line 124
importTaxes: There is already an active transaction on line 163
importCurrencies: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 124
importInvoices: There is already an active transaction on line 163
importTransactions: There is already an active transaction on line 163
importPackages: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 124
importServices: There is already an active transaction on line 163
importSupportDepartments: There is already an active transaction on line 163
importSupportTickets: There is already an active transaction on line 163
importMisc: There is already an active transaction on line 163

Thanks in advance

 

 

You have one or more contacts in your WHMCS install that do not have a client ID. Try modifying /plugins/import_manager/components/migrators/whmcs/whmcs_migrator.php line 399:

 

From:

		foreach ($contacts as $contact) {

To:

		foreach ($contacts as $contact) {
			if (!$this->mappings['clients'][$contact->userid])
				continue;
Link to comment
Share on other sites

no luck :(

 

I have check whmcs cliente and contact table ID's and userid and everything is OK

 

I also have trie to validate the null client_id on every statment on whmcs_migrator.php but the same error. Strange!!!!

 

Did you make the change I suggested? If so, there's no way you could receive the same exact error as the code would not have executed that far.

Link to comment
Share on other sites

Hello again

 

Just to say, my mistake, the error was similar but diferent, this time was invoices and also client_id

 

I have change from

		foreach ($invoices as $invoice) {

to

		foreach ($invoices as $invoice) {
		  			if (!$this->mappings['clients'][$invoice->userid])
				continue;

and have imported everithing :)

 

I will no check some random data to see if all is OK ;)

 

Many thanks once again.

 

Best Regards,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...