Jump to content
  • 0

Clear Client Data For Production Launch


stonedeft

Question

Hello,  

 

I am now done with tweaking and modifying some sections of blesta. 

While doing so I have created test Client accounts, services and transaction. 

 

I am now ready to go live and upload on a production server. 

 

I would like to delete all of the test accounts, with related services, invoices transactions, payment accounts and support tickets.  

 

I tried manually truncating the following tables. All seems well but when I tried to run Cron, something broke. 

 

accounts_cc
clients
client_account
client_notes
client_settings
contacts
contact_numbers
contact_permissions
cron_task_runs
invoices
invoice_delivery
invoice_lines
log_account_access
log_contacts
log_cron
log_emails
log_gateways
log_transactions
log_users
services
services_domains
service_fields
sessions
transactions
transactions_applied
 

What Database Tables do I need to truncate. 

 

Thank you. 

 

 

 

 

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

if you have zero real customers, bellow sql is what I had to do in similar case, it's remove all row in each considered table:

 

Run one line by one sql query:

truncate support_replies;
truncate support_tickets;
truncate invoice_delivery;
truncate invoice_lines;
truncate invoices;
truncate order_services;
truncate orders;
truncate service_fields;
truncate services;
truncate transaction_applied;
truncate transactions;
truncate log_account_access;
truncate log_contacts;
truncate log_emails;
truncate log_gateways;
truncate log_modules;
truncate log_phpids;
truncate log_services;
truncate log_transactions;
truncate log_users;
truncate log_cron;

 

 

But save your database before, so if you find it's not fine for you, you can back
 

Link to comment
Share on other sites

  • 0

Just re-install Blesta. You shouldn't use a production environment for testing on, or you should have a backup database to restore.

 

I cannot reinstall, I have some modifications on the database structure and heavy mods on some controller files.

 

I just need to delete all clients and all services, invoices and transactions.  

Link to comment
Share on other sites

  • 0

I cannot reinstall, I have some modifications on the database structure and heavy mods on some controller files.

 

I just need to delete all clients and all services, invoices and transactions.  

 

Well just make the "test" accounts as fraud then or inactive and move on otherwise you've learnt the lesson to backup the database before adding test accounts on a live installation. Or you can delete stuff from the database which you believe should be removed and if it breaks the installation then you learnt the lesson that way...

Everyone here will state that you need to backup before doing test accounts and before upgrading / migrating.

Link to comment
Share on other sites

  • 0

I cannot reinstall, I have some modifications on the database structure and heavy mods on some controller files.

 

I just need to delete all clients and all services, invoices and transactions.  

 

what you will do in case of upgrade ?

 

you need to truncate orders table ,and some other tables also ....

 

as licensecart suggested , re-install blesta , but before save your currecnt database tructure to compare it with  the new tables . 

 

another soltion is to not delete any thing, just change the autoincrement number of invoice to begin from the first :)

Link to comment
Share on other sites

  • 0

what you will do in case of upgrade ?

 

you need to truncate orders table ,and some other tables also ....

 

as licensecart suggested , re-install blesta , but before save your currecnt database tructure to compare it with  the new tables . 

 

another soltion is to not delete any thing, just change the autoincrement number of invoice to begin from the first :)

 

I will never upgrade. Plugin system cannot handle the heavy modifications to meet our company requirements.

 

I reviewed the "delete client" and "delete users" routines under the method validateClientDeleteable() of the Clients Model, it checks if user has services, invoices and transactions, so logically, if I truncate those 3 tables I can successfully delete the client.      

 

I may leave footprints behind on other tables , but I think it will not break the system. 

 

fingers crossed  :mellow:

Link to comment
Share on other sites

  • 0

I will never upgrade. Plugin system cannot handle the heavy modifications to meet our company requirements.

 

Seems risky and a lot of work if you do update in the future.

 

Why not just make a script which would make the modifications to the database you have done and use vqmod to edit the core files? (I really don't expect you to do this as you have finished your project already it is just a suggestion for the future if you ever do need to upgrade the system)

Link to comment
Share on other sites

  • 0

Seems risky and a lot of work if you do update in the future.

 

Why not just make a script which would make the modifications to the database you have done and use vqmod to edit the core files? (I really don't expect you to do this as you have finished your project already it is just a suggestion for the future if you ever do need to upgrade the system)

 

or diff :)

Link to comment
Share on other sites

  • 0

Seems risky and a lot of work if you do update in the future.

 

Why not just make a script which would make the modifications to the database you have done and use vqmod to edit the core files? (I really don't expect you to do this as you have finished your project already it is just a suggestion for the future if you ever do need to upgrade the system)

 

This is a problem when dealing with Blesta. SO many things missing or not functioning as expected from better systems (ubersmith) that I see I am not the only one planning on completely stopping any further updates to Blesta and basically forking into my own custom edition of something that cant really be called "Blesta" anymore as too many mods to work for company requirements have been made.

Link to comment
Share on other sites

  • 0

This is a problem when dealing with Blesta. SO many things missing or not functioning as expected from better systems (ubersmith) that I see I am not the only one planning on completely stopping any further updates to Blesta and basically forking into my own custom edition of something that cant really be called "Blesta" anymore as too many mods to work for company requirements have been made.

as a developper and i have make a a lot of custom work for blesta, the only issue that i really miss is the events , if blesta can add more events , that mean w can add/edit/delete so many functions without touching the core files . and that is what the client really need .

working with blesta code is amusing and so easy to implement so manything , and for that i see a lot are encouraged to change/hack the core files .

just to note, i have more than 1 year asking blesta to add more event in their functions , and if we compare , 70% of plugins has been released after just adding some new event in v 3.3 n but is a pain that from v3.3 to 3.5 only 2 events i think has been added .

Link to comment
Share on other sites

  • 0

if you have zero real customers, bellow sql is what I had to do in similar case, it's remove all row in each considered table:

 

Run one line by one sql query:

truncate support_replies;

truncate support_tickets;

truncate invoice_delivery;

truncate invoice_lines;

truncate invoices;

truncate order_services;

truncate orders;

truncate service_fields;

truncate services;

truncate transaction_applied;

truncate transactions;

truncate log_account_access;

truncate log_contacts;

truncate log_emails;

truncate log_gateways;

truncate log_modules;

truncate log_phpids;

truncate log_services;

truncate log_transactions;

truncate log_users;

truncate log_cron;

 

 

But save your database before, so if you find it's not fine for you, you can back

 

 

 

Thank you this works... Kudos!!!

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
Answer this question...

×   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...