Import/export variables
It would be great to be able to import and export variables between sites. In my example it would be useful because so many of the site settings are now contained there. I could issue upgrades to people without having to recreate the same sets of fields on each site.
There could be a check box for if you want the contents of the variables exported too.
Just an idea.
Replies
Low 24 Jan 2010 09:45
Hey Robin. Seems like a rare case, but I'll think about it. You could also, for stand-alone installations, export/import the exp_global_variables and exp_low_variables tables using phpMyAdmin.
AJ Penninga 29 Jan 2010 19:51
Along this idea, it'd also be nice to import a csv list.
Loren Klingman 23 May 2013 02:38
On the same note as this, we are working on an MSM install where we will be making the other sites by copying the main site. Is there a way to copy the low variables over to the new site? (Either within the site creation wizard or by some kind of import/export.)
Since we are going to be doing this 8 times for 50 variables, it seems like it will be worth it to us to code something. If you are interested in being paid to do it, helping us do it, or paying us to contribute the code back, do let us know.
A note on our timeline:
We will be in need of this as soon as possible, but no later than June 11th. (I will be out of the office June 3-7 so dependent on the number of bugs we find, it could take a little longer than June 11th to be final, but I would expect a stable version of something to test by the 10th.)
Low 23 May 2013 07:12
The native Global Variables are already copied over to the new site, and Low Variables will use those to start with. However, all the meta data, like label, type and settings are not copied over.
This is a very tricky issue to get right. Types like Select Entries might relate to non-existing channels, and 3rd party types like Matrix need their own new table records.
I've looked into this multiple times, but cannot see a way where this is 100% reliable and usable, so I've decided against building this into LV.
Loren Klingman 23 May 2013 07:37
Yeah, I don't want to copy the data in the field, but all the settings.
So Matrix needs settings saved in it's own table or just you would have to copy out of its table to make it copy the data?
I plan to write a separate plugin to reconfigure the related playa fields, but if I can get the text/WYGWAM/etc settings right, that is at least a good place to start even if Playa is still a bit messed up.
Low 23 May 2013 07:47
Per variable type, basic Matrix settings are stored in exp_low_variables.variable_settings (serialized and base64_encoded). But records are also added to exp_matrix_cols and a column is added to exp_matrix_data for each Matrix column added. Those last two actions are done by Matrix itself, not by LV.
Something similar is most likely true for Playa fields.
Note that this is something that's done by 3rd party fields, where LV merely acts as a sort of platform for those to work on. LV facilitates, but the data structure behind it, is up to P&T, in this case.
Loren Klingman 23 May 2013 09:16
Ok, thanks, I'll see what I can hack together to make my site copies go easier. I may have to redo the matrix fields manually, but maybe I can get the rest.