[Moodle] Migrating established Moodle to new server

Michael Greenhill mi at whsc.vic.edu.au
Mon Sep 8 11:44:27 EST 2008


Database files from an older version of MySQL can sometimes introduce
problems when copied straight into a new version of MySQL. For this reason
it's advisable to dump the database from the old server and import it to the
new server. 

 

If you have access to PHPMyAdmin on both servers, this is how to do it: 

 

1.    On the old server, select your database from the drop down list on the
left. Once it's loaded, click the "Export" tab. 

2.    Make sure all the tables in the multi-select field are selected. Chose
the "SQL" option from the export list, and ensure the following checkboxes
are checked:

a.    Structure

b.    Add DROP TABLE / DROP VIEW

c.     Add AUTO_INCREMENT value

d.    Enclose table and field names with backquotes

e.    Data

f.     Complete inserts

g.    Extended inserts

h.    Use hexadecimal for binary fields

i.      Save as file

Also ensure that the export type is set to "INSERT"

3.    Set compression to "zipped"

4.    Press "Go"

5.    That will (eventually) present you with a download file dialogue box.
Save the file to your computer - you've now got a local backup of your
database. 

 

On the new server.

 

1.    Select the database from the drop down list on the left, and click the
Import tab

2.    Click the browse button, and select your newly downloaded database
dump, and press Go

3.    Done!

 

If both servers are running Linux and you have shell access, it's far
simpler. Issue the following commands on the new server (you'll have to have
a MySQL account that has remote access enabled):

 

mysqldump -u [username] -p [database name] -h [ip address of your old
server] > dump.sql

mysql -u [username] -p [database name] < dump.sql

 

Example:

 

mysqldump -u moodleuser -p moodle -h 192.168.0.50 > dump.sql

mysql -u moodleuser -p moodle < dump.sql

 

Michael Greenhill
IT Technician
Wheelers Hill Secondary College
+61 03 9561 5811

-----Original Message-----
From: moodle-bounces at edulists.com.au [mailto:moodle-bounces at edulists.com.au]
On Behalf Of Chris Ellis
Sent: Monday, 8 September 2008 11:09 AM
To: The Moodle Users' in Schools Mailing List
Subject: Re: [Moodle] Migrating established Moodle to new server

 

If you have full access to the server I'd make a copy of the  

Moodledata and mySql folders.

 

Take moodle off-line. Rename the Moodle folder to something like  

MoodlePreUpgrade so you have a copy of everything such as style  

sheets, config files, additional modules, etc.

 

Upload and extract your latest Moodle install into your web server  

folder and rename the extracted folder back to Moodle.

 

Copy across config files etc from the MoodlePreUpgrade folder.

 

Browse to myusualmoodleURL/admin and the update script should run.  

Your database files will be where they should be without having to  

bother with backup and restore SQL dumps (and you also have a copy of  

the MySQL folder for safety)

 

Put Moodle back on line.

 

This is how I've dealt with the last couple of updates and works the  

best and simplest.

 

If it all falls over, delete the new install moodle and rename your  

preupgradefolder back to Moodle and you'll be back where you started.

 

Cheers

 

Chris Ellis

ICT Coordinator

Lorne-Aireys INlet P-12 College

ellis.christopher.l at edumail.vic.gov.au

 

 

 

 

Important - This email and any attachments may be confidential. If received
in error, please contact us and delete all copies. Before opening or using
attachments check them for viruses and defects. Regardless of any loss,
damage or consequence, whether caused by the negligence of the sender or
not, resulting directly or indirectly from the use of any attached files our
liability is limited to resupplying any affected attachments. Any
representations or opinions expressed are those of the individual sender,
and not necessarily those of the Department of Education and Early Childhood
Development.

_______________________________________________

http://www.edulists.com.au - FAQ, resources, subscribe, unsubscribe

Moodle Mailing List kindly supported by

http://www.vcaa.vic.edu.au - Victorian Curriculum and Assessment Authority
and

http://www.vitta.org.au  - VITTA Victorian Information Technology Teachers
Association Inc

-- 

-- 
Important Notice:
This email is for the named recipient only. Its contents are confidential.
If you are not the authorised recipient you must not use, disclose or copy any 
of these contents.
If you receive this email in error please contact us immediately and delete the 
email from your system. Representations or opinions expressed are those of the 
sender & not necessarily those of Wheelers Hill SC.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.edulists.com.au/pipermail/moodle/attachments/20080908/ec013ecd/attachment-0001.html


More information about the moodle mailing list