Jump to content

Importing WHMCS into WHMCS?


Recommended Posts

WHMCS uses sql to hold it's data. Why not just create a simple php script to pull the info table by table from one DB, and insert into the other?

 

ie (not valid code, but you get the idea):

 

For Each Table in DB1 Select * from Table

$ThisRow=Result

Connect to DB2

Insert into Table ($ThisRow)

 

 

Shouldn't take but an episode of your favorite show to code and implement...

 

For that matter, you could just export to file, and import using any of the free utils out there.

Link to comment
Share on other sites

WHMCS uses sql to hold it's data. Why not just create a simple php script to pull the info table by table from one DB, and insert into the other?

 

ie (not valid code, but you get the idea):

 

For Each Table in DB1 Select * from Table

$ThisRow=Result

Connect to DB2

Insert into Table ($ThisRow)

 

 

Shouldn't take but an episode of your favorite show to code and implement...

 

For that matter, you could just export to file, and import using any of the free utils out there.

And this solution would renumber invoices and/or client ids appropriately with the conflicts between the too? sm-nachdenk.gif
Link to comment
Share on other sites

I can't believe noone else has ran into this issue before.. or atleast, they aren't willing to share..

 

I would imagine, since Matt would know the script the best, and is noticing more and more people using it that he would write an import script going from one to another.

 

I guess on the same note, the import of one whmcs to another whmcs is a possible 'loss' as someone looses a license customer.

Link to comment
Share on other sites

I hadn't thought of the numbering conflict. (I wrote that in the middle of the night). It might be easier to get someone to code a custom mod, if you don't want to go through the trouble. Sounds like an interesting project though. I only wish I had the time.

 

If anybody is interested, my 2 cents... I haven't got around to looking at the DB yet, but 20 years of coding leads me to believe that this is as any other relational DB: The tables are based on an index, most likely numerical. Therefore, I would proceed as follows:

 

In DB1 Select * from clients

$ClientOffset = mysql_numofrows(result)

For Each table in DB2 For each row in table ClientID = ClientID + ClientOffset

 

Repeat procedure for each index (invoiceID, PaymentID, etc)

 

 

Hopefully that can give someone a starting point.

Link to comment
Share on other sites

Well as I noticed in Matt's earlier post "at the present time" which I would assume means he is either considering it or it is already in the works ;)

 

I agree that it would be useful for any company acquiring another that is running WHMCS or one that uses it for 2 that may be joined into one at some point.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated