Hello Emad,
I am afraid that you can't migrate MOODLE if you can't perform some of the following steps:
Fisrt one is to backup the database as Howard previously mentioned.
In
order to backup the database you will have to use shell, probably
on port 22 If your
server
is on Linux. If
so, you will need to make database dumping by typing: sudo
mysqldump -u DATABASE_NAME -pPASWORD | gzip > /tmp/moodle/database.sql.gz
You
need to acknowledge that, in order todump & pack the database to /tmp/moodle/
directory, the mentioned directory (moodle) need to exist on your web server. So, before
executing the first command, please create moodle directory by
typing sudo mkdir
/tmp/moodle. Then type cd /tmp and then enter.
Finally, just type sudo chmod 777
moodle.
Now you can dump the database by using the command described in the first paragraph.
If you like, you could send a copy of your database to your email address. The command
would be: echo "Database Dumping" | mutt -a "/tmp/moodle/database.sql.gz" -s
"MOODLE " -- your@email.com
Second step involves the use of FTP client for copying the source
code of your moodle
directory under public www, or public_html (location is usually /var/www/). So, just copy all
the files from the server to your hdd. Finally, locate your moodledata directory. The default
location for this directory is usually something like
/var/moodledata. Copy all the content
to your local hdd.
Now, you can extract and check the content of your database. If the sql file is ok, then you
can upload this sql file on your new server. Use the same location: /tmp/moodle
/database.sql.
Now, please create a new database on the new server by typing:
CREATE DATABASE
'moodle' CHARACTER SET utf8 COLLATE utf8_general_ci;
By having database created, you can import the content of the
previously mentioned
database.sql. So, just type: mysql -u root -p moodle < /tmp/moodle/database.sql
By executing this command you will have to import the content to your new empty moodle
database.
The final step is to create moodledata on your new server. Please
use sudo mkdir
/var/moodledata, and then upload the content of your previously created copy of moodle
data from the first server.
Please upload the source code of your moodle directory to /var/www/.
Finally, edit the config file by using sudo nano /var/www/config.php. You should locate the
line $CFG->wwwroot = 'http://localhost/moodle';. Please replace the localhost with the IP
address of your Web server.
And that's it. Have fun!