Topic: Restore backup of multiple companies and upgrading

So, I just got a backup for a database with multiple companies data in it. The version is 2.3rc.
So, I need to select one of the company as parent company (that cando system setup, install module, etc). I know the table prefix. How to setup as parent company?

As for upgrading, is it possible to upgrade directly to 2.4.6 from 2.3rc?

Re: Restore backup of multiple companies and upgrading

You can set the default company in Create/Update Company; is that what you want?

For a new installation of V2.3 using one of the companies from your backup

1. Select all tables with your chosen prefix copy this to a new file
2. Find and replace prefix with 0_
3. Save file: after install upload file, select file in Backup & restore and restore.

Don't think its possible to go from 2.3 directly to 2.4.6 have a look at the 'Announcements' forum; read the 'Sticky' posts.

Please note there are DB changes, so the company template you made above with have to be changed OR upgraded for 2.4.6

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Restore backup of multiple companies and upgrading

is the default company flagged which one that has system setup priviledge?

As I remember, FA has upgrade functionality. I remember I used back then. It will automatically append some new database table/column. Because I only have the backup database, I wonder if I can do it without installing it to 2.3 first. I notice the announcement usually is about the source code and not database.

Re: Restore backup of multiple companies and upgrading

No, system setup priviledge remain with the 1st company.

Yes you are right, but I'm still not sure for your case that you can? 

You are 'restoring' a company from your newly made parent company(2.3)

So briefly with lots of steps missed...normal - existing 2.3 installation, upgrade software to 2.4, then use installation to upgrade DB to 2.4.

You want to install fresh installation of 2.4 then 'restore' with a 2.3DB, the upgrade the DB to 2.4.


You could just try it then compare finished DB with DB that's included; but is it worth all the unknowns and the risk to your DB integrity?

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Restore backup of multiple companies and upgrading

Not sure if this is the right thread. I had to create a new company fast, and as I had a copy of my principal company on a PC, I thought the easiest was to create the new company in that copy. Unfortunately I didn't create a new database, so now I have both companies in the same database (the first and the second). I don't really need the copy of my principal (first) company, so I thought the easiest would be to eliminate that, and keep the new company, I created (and which already has a lot of data in it).
Is there are way I can eliminate the first company without damaging the second? I can see that even though I have made the second company the default, the first company still has the privilege to configure the system. So I can imagine it will not be possible to delete? Or is there any other way I could do it? E.g. create a new company (preferably in a second version of FA) and migrate only the data from the second company?
I can of course keep both companies and simply ignore the first one. However, as the first company is very heavy in data and the backup is already around 80 MB (before compressing), it would be good to get rid of it (short of simply deleting all the preceding years).
I am running FA 2.4.4 on a LAMP setup.

6 (edited by rafat 07/26/2021 09:35:44 am)

Re: Restore backup of multiple companies and upgrading

@thorbjornw

Yes it can be done. But I would not recommend it. If you are  worried about the backup size then its not because of the first company. When you do backups within FA its by company data and not the entire db. Backups within FA are  named after company prefix within the DB. i.e 0_ is for the first installed company that cannot be deleted, and  1_ for the second company ...etc..

In post #2 above @poncho1234 has hinted on how you can do that. I will elaborate further.

I assume your existing installation has two companies. the old company with prefix 0_ and the new company with prefix 1_ you can find out the used prefixes when you login to the old company  and go setup->Create/Update Companies Table Pref.

Now:

1. Log in to the new company Setup-> Backup and Restore.
2. Create Backup
3.Choose the Backup and Download it.
4. With a text Editor open the file just downloaded. (must have _1_ char in it if the company prefix is 1_)
5.Find and replace `1_ with `0_ in all occurrences. (Replace All)
6. Save file
7. Install another instance of FA
8. On new instance go Setup->Backup and Restore->Choose file saved in step 6 and then Upload file ->Restore Backup.

Now you will have one company with all the second company data with prefix 0_

Good luck.

Re: Restore backup of multiple companies and upgrading

Thank you for the explanation, sounds right. I will give it a try. As I will be creating a new FA instance, it should be risk free. I shall come back when I have tried (may take a couple of days as I need time to do that).