Issue Details (XML | Word | Printable)

Key: MDL-15635
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Penny Leach
Reporter: Penny Leach
Votes: 0
Watchers: 5
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

[gsoc] database migration utility

Created: 13/Jul/08 09:04 PM   Updated: 17/Jul/08 06:41 AM
Return to search
Component/s: Database SQL/XMLDB
Affects Version/s: 2.0
Fix Version/s: 2.0

Issue Links:
Relates
 

Database: Any
Participants: Andrei Bautu, Dan Poltawski, Eloy Lafuente (stronk7), Penny Leach and Petr Skoda
Security Level: None
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE

Sub-Tasks  All   Open   
 Sub-Task Progress: 

 Description  « Hide
Utility to completely export and import a moodle database in a db-neutral format/

After a long discussion, Petr and I agreed on the following:

1. Data should not use STATEMENT but instead we will add a new part to the XMLDB file, CONTENT or something similar which contains all the data (Eloy to help here to decide the exact format)

2. Current pieces of data in the XMLDB file should move from STATEMENT to CONTENT so that they are handled by dml rather than ddl.

3. The export file should contain both schema and data, but the schema should come from the code install.xml, and should not be used when importing, but used to compare with the target system code.xml (so as to not try to import data into a schema that does not fit it)

4. Introduction of new $DB->import_record function (used to import CONTENT parts of install.xml)

5. Introduction of new contract reset_sequence function (for given table or all tables) to be implemented per driver (postgres will set sequence value, mysql will probably do nothing, not sure about ora or mssql yet)

6. Different ways to export and import moodle database:

- During moodle installation, add hook to install from a file or a remote database (before first steps that insert data, ideally)
- Admin UI - blow away current database (truncate tables) and import data from file or connection to remote database
- Admin UI - export current database to file, or into remote database

General notes:

Schema should never be imported, only used for comparison.
Export file should contain moodle version (it is in data content already but it should also be in xmldb if not already) and this should be checked at import time.


Andrei - I would like you to create subtasks for each individual component here you can see and write a specification in the wiki before you write any more code here. I am aware this is different to what you've already implemented (although I hope you'll be able to reuse much of the code) and I want to avoid this happening in the future ( this is definitely at least my fault in part for not getting back to you sooner )

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda made changes - 13/Jul/08 09:08 PM
Field Original Value New Value
Link This issue has a non-specific relationship to MDL-15071 [ MDL-15071 ]