Wiki ⇒ v10 Developer's manual ⇒ Database Migration ⇒ CPG Dragonfly™ CMS
Wikiv10 Developer's manual ⇒ Database Migration

14. 4: Database Migration Parent


Unlike YII, Laravel and Dragonfly v9, Dragonfly v10 has no big clumsy migration tool.
The problem we encountered with those was when faulty/duplicate updates occurred.
You would end up with a corrupt database with no point of return.

Instead, Dragonfly CMS v10 uses an XML based schema/data builder.
Go to: Admin -> System -> Database
There are 3 options of interest in de select box:
  • XML Backup Data
  • XML Backup Schema
  • XML Installer

Example XML Data

<?xml version="1.0"?>
<database version="1.0" name="dragonflycms" charset="utf8mb4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<table name="cms_config_custom" onduplicate="IGNORE">
<col name="cfg_name"/>
<col name="cfg_field"/>
<col name="cfg_value"/>
<tr><td>global</td><td>sitename</td><td>CPG Dragonfly™ CMS</td></tr>
</table>

</database>

Example XML Schema

<?xml version="1.0"?>
<database version="1.0" name="dragonflycms" charset="utf8mb4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<table name="config_custom" comment="Custom add-on configurations so they won't have to build the" engine="MyISAM">
<col name="cfg_name" type="VARCHAR" length="20" binary="true"/>
<col name="cfg_field" type="VARCHAR" length="50" binary="true"/>
<col name="cfg_value" type="TEXT" binary="true" nullable="true"/>
<key name="PRIMARY" type="PRIMARY">
<col name="cfg_name"/>
<col name="cfg_field"/>
</key>
</table>

</database>


Created: Monday, July 11, 2016 (22:29:23) by DJ Maze