Copying layouts between multiple environments

Hi,
So a bit a tricky case here. We have a forest environment running a normal forest backend. Then another environment running a consolidated version - meaning it shows data using two separate db connections. (ref: https://github.com/ForestAdmin/forest-examples/tree/master/examples/sql-database/multiple-databases).
I want to copy the layout of the original env with only 1 db attached to the env with 2. In fact I even tried to do this and I just got locked out of the second env and had to revert back. Furthermore, copying the layout includes summary views, ordering of columns in a table, and custom labels/badges used on smart field etc?

Thanks in advance!

Hi @imanm,

First of all, the link you referenced here points to a really outdated way to handle multiple database. If you need to use forest on multiple databases at the same time, I strongly advise to follow this documentation instead: https://docs.forestadmin.com/documentation/how-tos/databases/plug-multiple-sql-databases

As for your copy layout issue, I’m not sure to understand what caused it. What the copy layout does is to take all layout related modifications you did (ie. column or collection reordering, charts, summary views, etc) and apply those to another environment.

More informations on the copy layout issue you encountered might be useful here (error logs, final state of your environment).

Hi @imanm,

The copy layout should work as expected in your project configuration.
As @lamatt_v explained, even if the environments are really different in terms of collections, fields, actions, … the “copy layout” will copy any origin configurations to the objects that exist in the destination.
In any case it should never fail and let you locked out.

Do you still observe the issue or should we close this discussion?

Thanks for you help :pray:

Hi Arnaud,

Thanks for the information.

I have not tried it recently and have actually almost manually copied over the layout now. However, the last time I did try, it no longer locked me out, but it wasn’t able to copy over the layout configuration properly either unfortunately.

Happy to close this issue though :slight_smile: