Skip to content

Adding export of data to JDatabaseExporterMysqli#10991

Closed
Hackwar wants to merge 4 commits intojoomla:stagingfrom
Hackwar:exporter
Closed

Adding export of data to JDatabaseExporterMysqli#10991
Hackwar wants to merge 4 commits intojoomla:stagingfrom
Hackwar:exporter

Conversation

@Hackwar
Copy link
Member

@Hackwar Hackwar commented Jul 1, 2016

This change adds the export of data to the MySQL(i) exporter. Since we want to prevent a backwards compatibility breach, no method interface has been added to JDatabaseExporter, something that should be done when moving to 4.0.

The code is not really suitable for large tables, since it would eat up memory till it fails. There is little that we can do to fix that.

I've put this together rather quickly, so there are no unittests yet. If there is general interest in this, I'll provide them later.

@alikon
Copy link
Contributor

alikon commented Jul 2, 2016

sound interesting
JFactory::getDbo()->getExporter()->from($table)->withData(true);

but we need one for the importer
something like
JFactory::getDbo()->getImporter()->from($table)->asXml()->mergeData();

@wilsonge
Copy link
Contributor

wilsonge commented Jul 3, 2016

I'm interested but I agree - we need the opposite code in the importer and I think the default is probably always going to be off because of the large table issue. But it's definitely an option worth having

@Hackwar
Copy link
Member Author

Hackwar commented Jul 4, 2016

I've written an importer that should work for all databases. Again, this is very basic, but we should start somewhere.

@alikon
Copy link
Contributor

alikon commented Sep 26, 2016

For those intersted on testing this pr
i've made 2 cli script

  • one for exporting all tables and data from a current staging joomla install

https://github.com/alikon/joomla-platform-examples/blob/master/Joomla%2520CLI%2520App/cli/newExp.php

  • one for import all tables and data from the prevoius export

https://github.com/alikon/joomla-platform-examples/blob/master/Joomla%2520CLI%2520App/cli/newImp.php

before to run those CLI scripts you should apply #8615 with the fix for composite indexes see #8615 (comment)

then simply issue on your terminal the command php newExp.php for exporting tables & data

after simply issue on your terminal the command php newImp.php for importing tables & data

test that your staging site work as before

@joomla-cms-bot
Copy link

Set to "closed" on behalf of @infograf768 by The JTracker Application at issues.joomla.org/joomla-cms/10991

@infograf768
Copy link
Member

Closed as we have a new PR going further: #14272


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/10991.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants