Merge two anvil applciations in one

I’m trying to merge two anivl applications in one. I’m looking the faster and simpler method to do that, trying to avoid copy-paste of design and code activities.
Is it possible to import/ upload a form from an application to another?

If you download both apps with git, every form/module/server module is available as files/folders that can be copied and pasted much more easily.

1 Like

Thank you Duncan, I thought about thatsolution , but if I connect the apps with a repo inside my git I am going to lose all my past history? And if in future I want to downgrade my anvil plan how can i move back by using the anvil default repo?
Thank you

I don’t know about the downgrading part, but it does seem you can merge 2 git repos.

If you clone the app with git on your local machine, all of the git history will be retained. The origin is stored on Anvil’s servers. You can push any subsequent commits that you make on your local machine to the origin and they will appear in the Anvil editor.

If at some point you want to go back to a previous version of your app, you can reset a branch to a specific commit either from the Anvil editor or your terminal.

Clone the two app repositories to your PC (that’s git, nothing to do with GitHub), copy the forms and server modules from one app to the other, commit and push.

Now the second app has one commit that adds all those files. You will obviously need to fix the code so the new forms are correctly used.

Another strategy that could apply in some cases, would be to setup the forms of one app as usable as custom components, add the app as dependency to the second app, then use those forms as components. This requires more work, but allows to merge the forms of the app with custom components with as many apps as you like.

2 Likes

If you want to go for a simple way (without using any git branches), why not add the second app as a dependency to the first one? You can access all the methods of that dependency from your main app and also open forms on it.