Exchanging ‘Database Activities’ among Moodle courses

MoodleThis is a howto about exchanging databases among Moodle 1.9.x courses.

If you made a database activity in one course and them you want to export it to another course in the same or different server you should proceed in this way:

a.- Go to a tab menu called ‘Presets’ in database activity
b.- You will find an option to export the database schema (fields, templates..) to a zip file or to save a copy in the same Moodle installation for being used in another (or the same) course. The presets don’t include data.
c.- Now, go to ‘Export’ tab and check CSV format and all the fields of your databases from where you wish to save data for exporting and click on the ‘Export database records’ to generate and download the CSV file.

Afterwards you will have two files:

  • A *.zip file for the database preset
  • A *.csv file for data from database

Now, go to the course from where you wish to import the database and proceed in this way:

  1. Upload the zip file to the new course file area
  2. Create a new database. Give it a name and a introduction, forget the rest of the options and click on ‘Save and display’ buttom at the bottom of the page to create the new database.
  3. Click on ‘Presets’ tab and choose the option to import from a zip file. Select the zip file you uploaded before to file area and click on ‘Import’ buttom.
  4. Check out the option ‘Overwrite current settings’. Click ‘Continue’. You have already imported the schema of the database.
  5. Now, it is time to import data, so go to ‘Add Entry’ and at the end of the form you’ll find a link ‘Upload entries from a file’. Click on it and, again, at the bottom of the new page you will find an option to upload entries from a CSV file. You just have to select the CSV previously downloaded to your PC and click on ‘Upload file’ buttom. Leave blank both ‘File delimiter’ and ‘File enclosure’  text fields due to the CSV file comes form another Moodle database so it is not necessary to change defaults.
  6. You have already imported the database to your course. Yo will only need to change the name and description of the database if its is needed.
Hope this short tutorial save your time if you ever need to do it.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.