Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Moodle migration.

Talk:Moodle migration: Difference between revisions

From MoodleDocs
m (lay out problem)
(sed line incorrect)
Line 2: Line 2:


The difficulty in migrating Moodle from one URL to another is to get the database right. But it might be a pitfall when you do not check your dirroot, datafolder etc too. Please feel free to add anything you feel appropriate to this page - it's a wiki :-) --[[User:koen roggemans|koen roggemans]] 06:20, 27 December 2007 (CST)
The difficulty in migrating Moodle from one URL to another is to get the database right. But it might be a pitfall when you do not check your dirroot, datafolder etc too. Please feel free to add anything you feel appropriate to this page - it's a wiki :-) --[[User:koen roggemans|koen roggemans]] 06:20, 27 December 2007 (CST)
== sed line incorrect ==
I'm completely new here so I don't want to just start coming in and making changes but the sed command for swapping the url in the mysqldump output is incorrect.
Currently it reads:
'''#sed -e 's/oldserver.com/newserver.com/' oldmysqldump.sql > newmysqldump.sql'''
This will work but it will only substitute the first instance of newserver.com on each line. It's possible for the mysqldump to leave several instances on a line so you could get an invalid database.
The correct version would be:
'''#sed -e 's/oldserver.com/newserver.com/g' oldmysqldump.sql > newmysqldump.sql'''
Note that the -e is not actually necessary with only a single substitution, but it doesn't cause any harm so I've left this unaltered.
Should I go ahead and amend the wiki?
-Taliesin Nuin.

Revision as of 15:23, 21 February 2008

Does anyone know why there is no mention of changing dirroot on this page? --Richard Enison 18:02, 26 December 2007 (CST)

The difficulty in migrating Moodle from one URL to another is to get the database right. But it might be a pitfall when you do not check your dirroot, datafolder etc too. Please feel free to add anything you feel appropriate to this page - it's a wiki :-) --Koen roggemans 06:20, 27 December 2007 (CST)

sed line incorrect

I'm completely new here so I don't want to just start coming in and making changes but the sed command for swapping the url in the mysqldump output is incorrect.

Currently it reads:

#sed -e 's/oldserver.com/newserver.com/' oldmysqldump.sql > newmysqldump.sql

This will work but it will only substitute the first instance of newserver.com on each line. It's possible for the mysqldump to leave several instances on a line so you could get an invalid database.

The correct version would be:

#sed -e 's/oldserver.com/newserver.com/g' oldmysqldump.sql > newmysqldump.sql

Note that the -e is not actually necessary with only a single substitution, but it doesn't cause any harm so I've left this unaltered.

Should I go ahead and amend the wiki?

-Taliesin Nuin.