Migrating with limited access

Migrating with limited access

by Emad Haddad -
Number of replies: 10

Hello everyone,

I am a website developer that is very new to Moodle. I was tasked with transferring a Moodle website from one server to another to redesign. 

I read through many helpdocs but I am still stuck. I have complete access to the new server and website but only have admin access of the Moodle (not the server or database) of the old. 

What can I do to migrate the website with this limited access? 


Thank you all in advance.

Average of ratings: -
In reply to Emad Haddad

Re: Migrating with limited access

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

"all" you need is a backup/dump of the database and the 'moodledata' (file upload) area. 

If your access is more restricted than that then there's nothing much you can do (apart from plead to the host). 

In reply to Emad Haddad

Re: Migrating with limited access

by Saša Stamenković -

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!


Average of ratings: Useful (1)
In reply to Saša Stamenković

Re: Migrating with limited access

by Emad Haddad -

Thank you all for the detailed replies.


The prior website administrator agreed to provide files but not any FTP or mySQL access.

Would it be correct to ask for the following:

  • Database backup/dump 
  • Moodledata folder (I'm just going to ask for the entire root website zipped up)

He doesn't have access to shell - but from my understanding from the many articles I read on migration, the dump and moodledata is all that's needed. 

Please advise if I should ask for any other files or correct me if I'm wrong.

At this point I redesigned the moodle and everything is set up on the new website - I'm just trying to restore the courses exactly as they were. 

Note to self: never take on a moodle website development project again. haha. 

Thank you all in advance! smile 

In reply to Emad Haddad

Re: Migrating with limited access

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
In reply to Visvanath Ratnaweera

Re: Migrating with limited access

by Emad Haddad -

One of the first articles that I found and read through.

Thing is - I'm a front-end dev / graphic designer. I've been stumbling my way through figuring out everything else. So the purpose of me asking is to confirm that I'm understanding correctly.

I know method 2 isn't an option for us as there is no shell access. Just want to confirm that the database backup and the moodledata file is all that's needed to complete method 1. 

I assumed the purpose of a message board is to have a community to receive feedback from. 


Thanks.

In reply to Emad Haddad

Re: Migrating with limited access

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Emad

You wrote:
> One of the first articles that I found and read through.

How are the others supposed to know that?

> I know method 2 isn't an option for us as there is no shell access.

Another handycap. Get ready for a long struggle.

> Just want to confirm that the database backup and the moodledata file is all that's needed to complete method 1.

Well, almost. If you know the exact version of Moodle, you can get the source downloaded anew. (Well, don't ask me how to do that without Git, which is a command line tool!) But you need one file from the moodle directory, the config.php file. All this assuming there were no code changes and you know the full list of additional plug-ins that were installed.

P.S. I read "moodledata file" in your post. You know that it is a directory?

P.P.S.
> I assumed the purpose of a message board is to have a community to receive feedback from.
Don't understand that either. But nothing relevant to your problem, I hope.
In reply to Emad Haddad

Re: Migrating with limited access

by Ken Task -
Picture of Particularly helpful Moodlers

config.php file of the original site is *VERY IMPORTANT* as well as the sql dump and the data directory.   Check out the version.php file as that will tell you what version of Moodle 2 they were running.  On the new location, get as close as you can to that version when acquiring the code for Moodle.

Ken


In reply to Ken Task

Re: Migrating with limited access

by Emad Haddad -

That was extremely helpful. Thank you!


I'm going to ask the prior web admin to update to moodle 2.8 before giving me the database backup and directory files. 

smile 

In reply to Emad Haddad

Re: Migrating with limited access

by Ken Task -
Picture of Particularly helpful Moodlers

Others might agree/disagree, so consider the following my own 'preference' from experience ...

That may/may NOT be good (uprading prior to moving) ... depending upon how current provider does the upgrade prior to acquiring code/sqldump/datadirectory.

If you do it that way, *test* the upgraded 2.8 at current location to make sure everything works - otherwise, your copy of SQL,DataDirectory, and config.php file is almost useless or would require some expertise to sort out.

And, hate to tell you this, but moving it also will mean possible tweaks to MySQL and to PHP in the new environment/server.   You can see most of what you might need to tweak in the php info link from the Site Admin - Server menu.   Won't show MySQL DB server settings however.

So have that person investigate current settings to save some time, other wise, you will be tweaking.

Think it best to find out what version ... get the highest code for that onto new server ... with SQL DB in place and data directory in place ... edited config.php to reflect new URL, location of datadirectory and DB user DB password DB name, it will then be a minor upgrade - like a 2.4.2 to a 2.4.highest.

Then test ... if no hickups, then upgrade.

You also need to then check the upgrade notes.

Nothing is ever as simple as it appears to be! :| (it is, once having had experience at it, however!)

'spirit of sharing', Ken

In reply to Emad Haddad

Re: Migrating with limited access

by Just H -

Hi Emad

What exactly do you mean by "At this point I redesigned the moodle and everything is set up on the new website..."?

If you are just talking about a theme, cool, if more than just a theme ... look on the time you've spent as practice smile

Migrating the site to your new server will mean you losing anything you've done on the new Moodle instance you've set up. Make sure you keep backups of everything you have done on the new server so you can reapply them.