Move Moodle to another server

Move Moodle to another server

by T Nguyen -
Number of replies: 9

I'd like to moodle from a Linux server to another Linux server.

Average of ratings: -
In reply to T Nguyen

Re: Move Moodle to another server

by T Nguyen -

How do I fix the below error?

In reply to T Nguyen

Re: Move Moodle to another server

by Kam Vento -
I found it easier to create a new installation. Use moodle to backup the entire course and classes from the original server then upload the files and restore to the new installation.
In reply to Kam Vento

Re: Move Moodle to another server

by T Nguyen -

I found two steps:

1) copy the moodle and data directories to the new server

2) back up the database from the old server using "mysqldump" and restore it on the new server using "mysql".

Thanks.

In reply to Kam Vento

Re: Move Moodle to another server

by Adam Van Auken -
Hi Kam,

I see in Moodle that you can backup but can you restore in Moodle?  How did you do that?  Thanks.
In reply to T Nguyen

Re: Move Moodle to another server

by Sreelakshmi Rao -

Please follow these steps:

1.Make a backup of moodle software directoty and moodledata folder.

2. Take a backup of the database using the below command:

    mysqldump -u username -p passwd database_name > filename.sql

3.create database on the new server by using create database query and   grant all the privilege given in installation documentation in moodle.org site.

4.Restore the backed up database using the below command:

mysql -u username -p passwd new_database_name < filename.sql

5.Poste your moodle folder  and moodledata folder in their respective directories.

6.Go to the url of your site and visit admin page and complete the setup.

If everything is restored correctly you will get successfully upgraded message.

All the best!

In reply to Sreelakshmi Rao

Re: Move Moodle to another server

by L. Vandijck -
Our Moodle site is hosted and the host allows use of phpMyAdmin. We succesfully backed up the database (using the "export" function, creating a dump) but can't restore it from the bachup file.
In phpMyAdmin we open a query window, select "import files", browse to the backup file (called database.sql) but nothin gets added or changed. As we are absolute beginners in this sql matter, we would creatly appreciate any help or suggestions.
Regards,
Leo
In reply to L. Vandijck

Re: Move Moodle to another server

by Julian Whitehead -
I tried this, and failed. For some reason I could not get phpMyAdmin to restore the database in a new installation.

In the end I had to back up each course individually to a local machine, then restore once I had carried out a clean moodle installation. This worked a treat!

Hope that helps.

In reply to Julian Whitehead

Re: Move Moodle to another server

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Have you considered using the moodle backup and restore, or is the issue to do with installing the actualy moodle (housekeeping) tables.?
In reply to L. Vandijck

Re: Move Moodle to another server

by Tim Allen -
What were the error messages?  Sometimes the problem is that the dump file is just too big to restore via a web browser.

If this is your problem, there is a great little script called Bigdump which can upload the file in successive sections.  It might help.

Another way is to upload the dump file via FTP to a folder on your server and then import it directly from there.  I'm not sure if this is possible on a shared hosting environment, as I have only done this on my own server.

Tim.