Jump to content

Getting a Fresh Start - Clearing clients, orders, and invoices from the database


epretorious

Recommended Posts

  1. I've been working on installing, configuring, and testing WHMCS for a few weeks now and, along the way, I've created a lot of bogus client accounts. As we're getting ready to go to Production I'd like to clear all of those bogus clients, their orders, and their invoices from the database (without losing the work that I've done [e.g., products+services, pricing, payment processing settings, registrar account info, etc])?.
     
    Is there a safe way to do this?
     
    In the past, using other MySQL-based Web applications, I've been able to remove records and reset the index by dumping the database, editing out the records, and then restoring the database using the edited dump file. Will this approach work with WHMCS?
    DROP TABLE IF EXISTS `tblaccounts`;
    CREATE TABLE IF NOT EXISTS `tblaccounts` (
     `id` int(10) NOT NULL AUTO_INCREMENT,
     `userid` int(10) NOT NULL,
     `currency` int(10) NOT NULL,
     `gateway` text NOT NULL,
     `date` datetime DEFAULT NULL,
     `description` text NOT NULL,
     `amountin` decimal(10,2) NOT NULL DEFAULT '0.00',
     `fees` decimal(10,2) NOT NULL DEFAULT '0.00',
     `amountout` decimal(10,2) NOT NULL DEFAULT '0.00',
     `rate` decimal(10,5) NOT NULL DEFAULT '1.00000',
     `transid` text NOT NULL,
     `invoiceid` int(10) NOT NULL DEFAULT '0',
     `refundid` int(10) NOT NULL DEFAULT '0',
     PRIMARY KEY (`id`),
     KEY `invoiceid` (`invoiceid`),
     KEY `userid` (`userid`),
     KEY `date` (`date`),
     KEY `transid` (`transid`(32))
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 [color="#FF0000"]AUTO_INCREMENT=10[/color] ;
    
    --
    -- Dumping data for table `tblaccounts`
    --
    
    INSERT INTO `tblaccounts` (`id`, `userid`, `currency`, `gateway`, `date`, `description`, `amountin`, `fees`, `amountout`, `rate`, `transid`, `invoiceid`, `refundid`) VALUES
    [color="#FF0000"](4, 11, 0, 'paypal', '2013-04-03 06:42:06', 'Invoice Payment', 30.00, 1.17, 0.00, 1.00000, '62G38316BD4769714', 10, 0),
    (2, 7, 0, 'paypal', '2013-04-02 01:15:20', 'Invoice Payment', 15.00, 0.74, 0.00, 1.00000, '9W869218M4007611K', 5, 0),
    (5, 12, 0, 'paypal', '2013-04-03 19:42:29', 'Invoice Payment', 1.00, 0.33, 0.00, 1.00000, '0GP06147TA978444Y', 11, 0),
    (6, 12, 0, 'paypal', '2013-04-03 19:53:57', 'Invoice Payment', 13.00, 0.68, 0.00, 1.00000, '6G284525RW397125M', 12, 0),
    (7, 14, 0, 'paypal', '2013-04-05 17:00:25', 'Invoice Payment', 1.00, 0.33, 0.00, 1.00000, '0DK07544L3215792R', 14, 0),
    (8, 15, 0, 'paypal', '2013-04-08 03:21:41', 'Invoice Payment', 3.00, 0.39, 0.00, 1.00000, '7K309537GP8653910', 15, 0),
    (9, 12, 0, 'paypal', '2013-04-17 04:33:17', 'Invoice Payment', 1.00, 0.33, 0.00, 1.00000, '7XE37167VW430321H', 27, 0);[/color]


  2. Besides the...
     
    • tblaccounts,
    • tblactivitylog,
    • tblcontacts,
    • tbldomains,
    • tblemails,
    • tblhosting,
    • tblinvoiceitems,
    • tblinvoices, and
    • tblorders

...tables are there any other tables that I need to clear (i.e., dump, edit, restore) in order to get a fresh start?

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