Transferring from Sandbox Site to Production Site

Transferring from Sandbox Site to Production Site

by Lisa Carothers -
Number of replies: 7

Hello,

I am a HS teacher who has ended up being the local guardian of our district's Moodle. I have administrative (as well as teacher) permissions, but our site is hosted by an outside company.

We are in the middle up upgrading from 2.7+ to 3.1+. Our host first upgraded our sandbox site. I reviewed how everything upgraded, added themes and blocks via Filezilla (with instructions from our host provider), and made lots of other changes like selecting and modifying the site theme.

I gave the go ahead to upgrade our production site, but nothing from our sandbox site transferred--no settings I had changed, nothing I had uploaded. I was told it doesn't work that way and that I would have to make all my changes and uploads to the production site.

What?! This makes no sense to me. Does it really work this way? 

Thanks for any insight or suggestions.

Lisa

Average of ratings: -
In reply to Lisa Carothers

Re: Transferring from Sandbox Site to Production Site

by Ken Task -
Picture of Particularly helpful Moodlers

'Does it really work this way?" .... bottom line ... yes.

The sandbox is/might be on another server ... IP address - domain name - URL ... from the production server.   They both have separate code directories, data directories, and data base servers/data bases - thus are really two separate sites ... not tied together in any form or fashion.

While this appears to be inefficient, it's not.   Upgrades sometimes brings issues so going through the entire process on a sandbox (that other teachers/students may not access) is a 'test run'.   One thing about such a setup ... you, the admin, get to step through things twice and you should, by having to re-do on production, should be fairly familiar with the new system.

No one likes to waist time ... but can tell you beyond a doubt there have been some sites where I was glad to have a sandbox 'run' before upgrading the production site.   Sandboxes gave me a chance to correct major errors that took a few days to solve.   Better a sandbox be down a few days rather than a production site being used daily.

'spirit of sharing', Ken



In reply to Lisa Carothers

Re: Transferring from Sandbox Site to Production Site

by Luis de Vasconcelos -
I was told it doesn't work that way and that I would have to make all my changes and uploads to the production site.

That's rubbish! When you upgrade and/or migrate Moodle all your student data and course info should be preserved.

Several things need to be migrated to the new production server when you do a server migration:

  • The Moodle code (copy it from the existing server or get it from GIT).
  • Your existing Moodledata folder (which is the folder that the $CFG->dataroot variable in your Moodle config.php file points to).
  • Your existing Moodle database ($CFG->dbhost and $CFG->dbname in your Moodle config.php file.
  • You may also need to do a DNS change to point your Moodle domain name to the new web server.

Then the upgrade is simple:

  • When you have completed moving to the new host and are ready to upgrade you first put Moodle into Maintenance Mode.
  • Then backup your Moodle database and the Moodledata folder.
  • Then you point your web server to the new Moodle 3.1+ code folder on the web server.
  • Go to the Notifications page in Moodle and Moodle will detect the new version. It will then guide you through the upgrade through to the end.

When the upgrade is complete you should have a 3.1+ site with all your course and student info intact.

If you want to move Moodle to a new SERVER / HOST and do an upgrade, it is best to do them seperately. First migrate the existing 2.7 site to the new web host. Test that everything was migrated successfully and that your courses and student info is all still intact. When that's signed-off you can do the 3.1 upgrade. This is safer than doing a migration AND upgrade at the same time. Too many things can go wrong...

https://docs.moodle.org/33/en/Moodle_migration describes the migration process in detail.

In reply to Luis de Vasconcelos

Re: Transferring from Sandbox Site to Production Site

by Ken Task -
Picture of Particularly helpful Moodlers

The op didn't share how setup and where hosted so it might not be 'rubbish'.  Might be a policy of the hosting provider.

From what I can gather op's site is hosted with remotelearner ... URL customer.remotelearner.com or something like that for production site.   Don't work for remotelearner, BTW.

IF hoster charges per account don't think I'd pay for a sandbox site IF it's not being used but once in a blue moon for upgrade testing and testing of themes/addons.   Sandbox site might include representative courses, methods of authentication, and a few student accounts for testing purposes - in which case cloning the successfully upgraded sandbox to production site would not be the way to go, would it?

Of course if sandbox was a recent clone of production (that included everything) then migrating the sandbox to production would make sense, but since it's remotely hosted and administered by the hoster, wonder how much that would cost?

'spirit of sharing', Ken


In reply to Lisa Carothers

Re: Transferring from Sandbox Site to Production Site

by Lisa Carothers -
So it appears I have two contradictory answers, but I bet they are both technically correct. When explanations involve dollar signs and strings of letters that don't form actual words, however, we've entered the realm above my head. I could share Luis's suggestions with our host provider, but I fear there will be a reason why that won't work, and in the time I will have spent going back and forth in their ticket system, I could have updated everything manually myself. That said, I will share those suggestions with the host when discussing future upgrades.


As I've been processing everything, I was actually coming to the conclusion I'd put in the extra time. I think I was looking for some verification that the host's message wasn't completely out of line before I donated even more time to the cause. At least everything in the sandbox site is as I left it, so I have that as a continual reference.

Thanks for the feedback!



In reply to Lisa Carothers

Re: Transferring from Sandbox Site to Production Site

by Ken Task -
Picture of Particularly helpful Moodlers

Welcome.  IF I found the right site, and your sites are hosted with RemoteLearner, they  either are still a Moodle Partner or a former Moodle Partner so they should know how to upgrade and/or migrate a sandbox to production and vice versa for sure.

Since this was your first time with them to upgrade, looks like you've chosen strategy to use hyperjumps from long term support to the next long term support version ... 2.7.x to 3.1.x.  3.1.x supported for security fixes until 2019, I think.

3.4.x is supposed to be the next release of a long term support version.   Might be wise to keep an eye on that and when it's released, upgrade your sandbox to oh say 3.4.1 or .2.   Think that would require upgrade to PHP and database might have to undergo some changes which you cannot perform.   Am certain your hosting provider can help with strategy. ;)

it's a journey ... never ending! ;)

'spirit of sharing', Ken


In reply to Lisa Carothers

Re: Transferring from Sandbox Site to Production Site

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Your sandbox site is a copy of your production site that you use for testing.  It probably does not have the most updated data but should be basically the same in the way of settings as your production site so that you can test out new plugins/themes etc.

What you do to your sandbox site does not affect the production site - that is the point.  You want a place to play that will not jeopardize your main site.  When you have figured out what you want to change, you then make the changes to your production site.  Yes, you have to do it all again but it should be a lot quicker as you can open pages in your sandbox site and just copy things over.  When you break your site because you were playing with plugins on a production site, you will learn to appreciate the sandbox site!!  Trust me, I know wink !!!!

Luis gave you the upgrade process but missed the fact that you are dealing with two separate Moodle installations so his information, while a nice explanation, did not apply to your situation.

In reply to Lisa Carothers

Re: Transferring from Sandbox Site to Production Site

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

When Moodle 3 was released, I wanted to start my Moodle site from scratch.  So I set up a MAMP sandbox site on my Mac and completely developed my new Moodle "offline" on my Mac.  I added courses, question banks, topics for every course, basically my completely new moodle site.  Then, when this looked good, I backed up the MySQL database and the moodledata folder, and then moved this information to a brand new, but empty, production moodle.  Everything went well.

Both my MAMP and my server Moodle were using the approximately same versions of php and MySQL, and of course both Linux.

Also, of course, I tested my ability to do this with some very small MAMP information, just to prove that I could do it before running off and completely developing my new moodle, which took about a month.