Has any one got a program to export specific layout based forms and lists

teryhill wrote on Monday, June 22, 2015:

I am doing a lot of work with layout based forms and I was wondering if anyone has come up with a way of exporting the layouts and lists by name. I have been just exporting them from PHPmyadmin.

Thanks

Terry

sunsetsystems wrote on Monday, June 22, 2015:

This feature was added about a year ago. Go to Administration -> Globals -> Features and turn on “Configuration Export/Import”, then go to Administration -> Backup -> Export Configuration.

Rod
http://www.sunsetsystems.com/

teryhill wrote on Monday, June 22, 2015:

Thanks. Is there a WIKI page for it?

Terry

teryhill wrote on Monday, June 22, 2015:

Will the import remove all the existing data or just the data that is being imported?

Terry

sunsetsystems wrote on Monday, June 22, 2015:

I didn’t write it up… it’s pretty self-explanatory, the main trick is to know to turn it on.

The import will completely replace whatever lists and layouts you are importing, but not any others.

Rod
http://www.sunsetsystems.com/

teryhill wrote on Monday, June 22, 2015:

Great

one last question, How does it handle going from 4.2(2) to 4.1(7)

Terry

sunsetsystems wrote on Monday, June 22, 2015:

Don’t know offhand. The exported data is just SQL, so you can look at that to check if all the columns exist in the older version.

Rod
http://www.sunsetsystems.com/

fsgl wrote on Monday, June 22, 2015:

Be aware that Configuration Import has a tendency for the second import to overwrite the prior import.

Tony suggested this method when he had asked for a copy of the Eye LBV forms. Fortunately I discovered this in the Demo & not on a production copy.

sunsetsystems wrote on Monday, June 22, 2015:

Right, when you are exporting and importing lists and layouts the IDs matter. If a list or layout with the same ID already exists then it will be replaced.

Rod
http://www.sunsetsystems.com/

teryhill wrote on Monday, June 22, 2015:

Thanks for the heads up fsgl. I will look at that.

Thanks for the information Rod This will be very useful to me.

Terry

fsgl wrote on Monday, June 22, 2015:

If a LBV form spans 3 tables like this one, Configuration Export/Import brought in layout_options & lost the data from the 2 other tables.

teryhill wrote on Monday, June 22, 2015:

Hummm Maybe better off doing it like I am doing it.

Terry

sunsetsystems wrote on Monday, June 22, 2015:

Not sure what you mean fsgl, but again exporting and importing a layout means replacing the entire layout having that layout ID.

Also replacing a layout may mean making its past visit data inaccessible, but it will still be in the database.

Again you can look at the SQL to see the details of what it will do. And if you’re careful you can even edit the SQL if your intent is to make mass changes, or to create a new layout by cloning an old one.

Rod
http://www.sunsetsystems.com/

fsgl wrote on Monday, June 22, 2015:

For IT folks, fine tuning is an option.

For those of us trained in other disciplines, tweaking .sql files is dangerous territory because it does not take much to nuke the database.

I remember Configuration Export/Import did not work at all with a complex NationNote. Even phpMyAdmin export/import was difficult but at least it was feasible.

teryhill wrote on Monday, June 22, 2015:

I am not seeing any data with the exception of the layout file name. No entries are being exported. This is all I get when I try to export a file. I broke it up to look at it It is actually 1 string in the export file.

Thanks
Terry

‘SET character_set_client = utf8;’ ;echo “DELETE FROM layout_options WHERE form_id = ‘LBFmtbi’;” ;
echo “DELETE FROM list_options WHERE list_id = ‘lbfnames’ AND option_id = ‘LBFmtbi’;” ;
C:/xampp/mysql/bin\mysqldump -u “openemr” -p"escargot" --skip-opt --quote-names --complete-insert --no-create-info –
where=“list_id = ‘lbfnames’ AND option_id = ‘LBFmtbi’” “openemr” list_options ;
C:/xampp/mysql/bin\mysqldump -u “openemr” -p"escargot" --skip-opt --quote-names --complete-insert --no-create-info –
where=“form_id = ‘LBFmtbi’” “openemr” layout_options ;

teryhill wrote on Monday, June 22, 2015:

It appears to be 070 (military malfunction code for broke)

Terry

sunsetsystems wrote on Monday, June 22, 2015:

Yes indeed. Looks like you are getting the mysqldump command itself instead of its output. Perhaps that means the program was not found or that the command line was otherwise invalid. You might try running it at the command line and see what happens.

Rod
http://www.sunsetsystems.com/

teryhill wrote on Monday, June 22, 2015:

It is probably because I am using Windows.

Terry

teryhill wrote on Monday, June 22, 2015:

Does this give you any clues

“echo ‘SET character_set_client = utf8;’ > C:\Users\terry\AppData\Local\Temp/openemr_config.sql;C:/xampp/mysql/bin\mysqldump -u “openemr” -p"escargot” --opt --quote-names “openemr” fee_sheet_options | C:/xampp/perl/bin\perl -pe ‘s/ DEFAULT CHARSET=utf8//i; s/ collate[ =][^ ;,]*//i;’ >> C:\Users\terry\AppData\Local\Temp/openemr_config.sql;" returned 255:

sunsetsystems wrote on Monday, June 22, 2015:

No. Try doing just this at a command prompt and see what error you get:

C:/xampp/mysql/bin\mysqldump -u "openemr" -p"escargot" --skip-opt --quote-names --complete-insert --no-create-info --where="list_id = 'lbfnames' AND option_id = 'LBFmtbi'" "openemr" list_options

Rod
http://www.sunsetsystems.com/