stonedeft Posted September 9, 2015 Report Posted September 9, 2015 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. Quote
0 serge Posted September 10, 2015 Report Posted September 10, 2015 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 INUMIO-Rob 1 Quote
1 Blesta Addons Posted October 10, 2016 Report Posted October 10, 2016 3 hours ago, INUMIO-Rob said: @serge Your solution still works! Thanks for that! I will do a plugin only for this purpose later ... it will be free . Michael, INUMIO-Rob and Paul 3 Quote
0 Michael Posted September 9, 2015 Report Posted September 9, 2015 Just re-install Blesta. You shouldn't use a production environment for testing on, or you should have a backup database to restore. Quote
0 stonedeft Posted September 9, 2015 Author Report Posted September 9, 2015 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. Quote
0 Michael Posted September 9, 2015 Report Posted September 9, 2015 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. Quote
0 Blesta Addons Posted September 9, 2015 Report Posted September 9, 2015 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 stonedeft 1 Quote
0 stonedeft Posted September 9, 2015 Author Report Posted September 9, 2015 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 Quote
0 mrrsm Posted September 9, 2015 Report Posted September 9, 2015 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) Quote
0 Michael Posted September 9, 2015 Report Posted September 9, 2015 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 Quote
0 Fantasma Posted September 9, 2015 Report Posted September 9, 2015 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. Quote
0 Blesta Addons Posted September 10, 2015 Report Posted September 10, 2015 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 . stonedeft, Michael and INUMIO-Rob 3 Quote
0 stonedeft Posted September 10, 2015 Author Report Posted September 10, 2015 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!!! Michael and INUMIO-Rob 2 Quote
0 INUMIO-Rob Posted October 10, 2016 Report Posted October 10, 2016 @serge Your solution still works! Thanks for that! Paul 1 Quote
Question
stonedeft
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.
What Database Tables do I need to truncate.
Thank you.
13 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.