Topic: removing a company messes up the system

I just installed newest FA for the first time. I saw that some demo data was also installed. After creating a new company, also demo data was installed. I wanted to remove it as there are no "iPad"-s in my inventory. However, it seemed to be an overwhelming process. So I installed Swedish chart and created a third company using that. No demo data - fine. Then, I removed the previous company. After a while of green rectangles, a yellow triangle with an exclamation mark was shown. Thereafter, FA demanded a system upgrade. A system upgrade was impossible as FA told me that... I can't even remember what. Anyhow, I looked inside the log file and there, a mysqli error was displayed: "0:admin:connect_db_mysqli.inc:127:[before upgrade] mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given". Then, I logged out. After logging in, I only see this: "Back

04/21/2019 | 08:51 pm    
FrontAccounting 2.4.6 - Theme: default -
FrontAccounting". Is the newest version of FA still beta? How can I reliably use it if I can't even log in now? What should I do?

Re: removing a company messes up the system

Start from scratch and install FA 2.4.6+ anew.
Use the en_US-new.sql chart - the one with no demo data for your default install and keep this "0" company as default. Only this company can create other companies.

FA has been in production use around the world for over a decade now.

Re: removing a company messes up the system

I discovered that after the above described process, the whole database is gone. Just gone, nothing left. If removing a company removes the whole database, it's critical and pathological to other companies, to the whole system.

Re: removing a company messes up the system

The first default company must not be removed.

However all is not lost.

Edit your config_db.php and set your default company to the index of the company you now have. It is also possible that your original company 0 database is still there and you can create a stanza for it in the sid file as well.

Re: removing a company messes up the system

As far as I get it, there's one database for the whole system, so it includes the stuff of all the companies. It's not like in "KwaMoja" where every company has its own database. And what happened is that the one and only database is gone. The system has deleted it. Maybe it's somehow connected to the system upgrade, however there was no reason for the upgrade as I installed the newest version.

Re: removing a company messes up the system

FA has the ability to use a different database for each company. When setting up a new company, choose the dbname as needed and make sure that the db user has the rights to create a new db or have it created and provide it's access credentials therein.

Deleting a company does not delete the database. It merely removes the stanza from config_db.php file. The database and the tables therein need to be removed manually.

Re: removing a company messes up the system

@peacecop kalmer: I had several testing with your way of company creations. Looks like if you used same database, for the all companies, the deleted company data's will be erased. If you tried in shared hosting or limited resource hosting, it may failed to complete the delete process.  Also the first company, you cant delete it. thats main company.

For this case, you can go with fresh install, and go with Swedish fresh COA from the begining. So it can be good to use, Always go with separate database for new companies.

@apmuthu, There is a program drawback, if you use the same database for second company,it removes the tables.  and if its new database, then the tables keep it.

We should think which one is right and we have to either allow delete tables, even if its new company. or keep the tables even if it uses the same database.

@joe,write your opinion here,

Re: removing a company messes up the system

Ok, we may rather need Janusz's opinion to this.

Joe

Re: removing a company messes up the system

We better add a checkbox there, if its checked, we can remove the tables . else we will leave the tables without deleting them.

Re: removing a company messes up the system

The database must not be removed at any cost as in shared hosting it may contain tables pertaining to other applications and the end user may not have permissions to create a new database at all.