How do you change Servers?

How do you change Servers?

by Bruce Selzler -
Number of replies: 8

Hello Team,

I'm very new to Moodle, and have looked through the forums but cannot find an answer to this question.

I've set up Moodle on a very low end system in order to learn it, and test the functionality. I'm also using it as a demonstration platform to show other teachers at my school how they can utilize online learning.  I am very impressed with the features and tool set of Moodle.  But its clear that I need to move the system to a more robust server.

My question is, how do I do this?  I've already created classes and lessons and I have other teachers doing the same.  I can set up a fresh install of Moodle easily enough, but how to do I get all of the data and content we are creating to the new server?

Any help on this would be greatly appreciated.

Thanks.

Average of ratings: -
In reply to Bruce Selzler

Re: How do you change Servers?

by Julian Whitehead -
This is a question that I would really like the answer to also.
I am guessing that it would be as simple as:
1) Use phpMyAdmin to Export a copy of your database
2) Add the database to your new host - not sure how to do this as phpMyAdmin looks quite complex.
3) Upload new moodle
4) Copy across the moodle data directory (and keep it in the same location).
5) Set up Config.php
Shouldn't it then work as was?
I am going to try it soon, (probably over Xmas), but would really appreaciate guidance also!
Cheers
Jools
In reply to Julian Whitehead

Re: How do you change Servers?

by Jay S -
This scares me.

What about all of my hacks, I exported the DB and imported into a new one. Then I copied moodle an moodledata pasted them as test and testdata. Changed the config file, no go.
In reply to Bruce Selzler

Re: How do you change Servers?

by Michael Penney -
Two ways. Julian discusses one.

If you don't have too many classes and/or aren't comfortable with phpMyAdmin, you can just backup each class on your original server, download the zip files of the backups, upload them to the new server's file's directory, and restore the classes to the new server.

The main issue I've found with phpMyAdmin is that it will ofent time out with larger databases, so you may want to use one of the client based MySQL admin tools or learn to use the command line to upload your SQL backup from the original site.

The built in backup restore procedure is probably the best method for a new user w/0 alot of MySQL experience.
In reply to Michael Penney

Re: How do you change Servers?

by Julian Whitehead -
Wow you mean I guessed right?
What kind of settings might I need on the export function in phpMyAdmin?
Then how on earth do I import?
Cheers
Jools
In reply to Julian Whitehead

Re: How do you change Servers?

by Michael Penney -
I'm using 2.5.6 right now, they move things around a bit in different versions. In 2.5.6, there is an export tab.

I usually do two exports, one for structure with
Add 'drop table'
Add AUTO_INCREMENT value
Enclose table and field names with backquotes.

Then I export data with
Complete inserts
Extended insert
export type insert.

Click save as file.

This will give you the raw SQL.

Then I import the structure. In 2.5.6, go to the SQL tab, and click the Browse button, below Or Location of the textfile. Upload it and it should run.

Do the same with the data file.

Note that you want to keep the database name & password the same or change your moodle/config file to match.

This works ok for small sites, if you have alot of data phpMyAdmin may time out. If so, you can try one of the desktop based apps. or copy and paste some of the SQL (not real fun) at a time.

If you have full access to both machines, you can also grab the myd and myi files for your database and move them to the other machine's MySQL data folder, this is definitly the easiest waysmile.
In reply to Bruce Selzler

Re: How do you change Servers?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
With MySQL you can just copy over the raw database files (if you have access to them on both servers).  To find them on your system, search for something like courses.myd

So as long as you move:

  - the databases
  - the code
  - the data directory

then you can move any Moodle site from any platform to any other.
In reply to Martin Dougiamas

Re: How do you change Servers?

by Jay S -
I did all of that. except I exported the db into an sql file.

My situation is, I'm using look comunications to host. I do not have much access to everything. I can't create dbusers.

Question 1
Since I copied over the files and created a copy of the database everything should be fine. What happens if the dbuser does not have the privilege to write to the DB. I think this is what has happened to me.

Question 2
I cleared the DB of its tables, uploaded a fresh version of 1.41 and started to install. Errors were givin while trying to insert data:

1142: insert command denied to user:

The dbuser can create not insert.