v3.0.1 - when backing up production server to standby server, new courses not showing

v3.0.1 - when backing up production server to standby server, new courses not showing

by Jeff Richardson -
Number of replies: 5

When I use a manual procedure to copy our production Moodle server to a standby server, new courses on the production server do not appear in the backup server.

both systems are running Ubuntu 14.04 and Moodle 3.0.1

Backup procedure is:
On Production Server

tar and zip  /var/moodledata  to moodleDATA.tar.gz
tar and zip /var/www/html/moodle to moodleHTML.tar.gz
mysqldump -u root -p (pw) moodledb > moodleSQL.sql
then move all archives to Standby Server

Restore procedure is:
On Standby Server

mv /var/moodledata /var/moodledata.bak
unzip/untar moodleDATA.tar.gz  to /var/moodledata

mv /var/www/html/moodle /var/www/html/moodle.bak
unzip/untar moodleHTML.tar.gz  to /var/www/html/moodle

mysqldump -u root -p (pw) moodledb < moodleSQL.sql

Problem is:
Courses created on Production server do not show up in the Standby Server.

Diagnostics:

  • parsing the moodleSQL.sql file shows the courses are present in the sqldump file
  • backups run from CLI as root user
  • file permissions/ownership are correct, server has rwx access to moodledata

Questions:

Do I need to backup and restore courses as a separate job from the site backup?
Do I need to create empty courses of the same name on the Standby server?
Is there another procedure for complete site transfer I should be using?

Any suggestions appreciated.

-Jeff


Average of ratings: -
In reply to Jeff Richardson

Re: v3.0.1 - when backing up production server to standby server, new courses not showing

by Ken Task -
Picture of Particularly helpful Moodlers

DB imported has retained URL's to original server ... production server.

Did you search and replace in standby server the URL's contained in the standby DB?

Search for 'production server URL' ... replace with 'standby server URL'.

Did you edit config.php flie of standby server to reflect new hostname/url?

https://docs.moodle.org/29/en/Moodle_migration

'spirit of sharing', Ken


In reply to Ken Task

Re: v3.0.1 - when backing up production server to standby server, new courses not showing

by Jeff Richardson -

Hi Ken,

Yes, config.php of the standby server had been modified with the new URL (it's a private IP). I can login to Moodle using the IP of the standby server. The URL in config.php of the production server is a domain name. 

I had not done the database search/replace, but after running the /admin/tool/replace script successfully (no errors shown) I still cannot see any new courses that were made on the production server.

We're running the Pioneer theme, if that matters . . . 

-Jeff


In reply to Jeff Richardson

Re: v3.0.1 - when backing up production server to standby server, new courses not showing

by Ken Task -
Picture of Particularly helpful Moodlers

Well, that's 'special'! :\

Turn on debugging on standby and work in the course area to see if there are any errors.

The standby server should be a mirror of the production - minus the URL to it.

Got any customizations?   Check those out.

Also check apache logs (error log) to see what, if anything, it's saying.

And these are both are 3.0.1's right?

It's easy to change the theme on standby to something standard to see if that's the issue.

'spirit of sharing', Ken

In reply to Jeff Richardson

Re: v3.0.1 - when backing up production server to standby server, new courses not showing

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
What you should be doing are: a) https://docs.moodle.org/en/Site_backup b) https://docs.moodle.org/en/Site_restore.

From your detailed description, you seem to be doing the right thing, almost:
- As pointed out, you need to edit config.php to match the standby server. You said later that you do it.

- Also, you need to search for the old URL in the database and replace it with the new one. You do with a text search-and replace on the database dump or run the "replace" tool - they are equivalent.

- 'mysqldump -u root -p (pw) moodledb < moodleSQL.sql'

Now that one is new to me. 'mysqldump' swallowing a dump? The Unix command program 'mysql' can do it, can 'mysqldump' do it too? OK, there is 'mysqlimport'. But it has different syntax.
In reply to Visvanath Ratnaweera

Re: v3.0.1 - when backing up production server to standby server, new courses not showing

by Jeff Richardson -

Yes Visvanath! new to me too.

"DOH!" - H. Simpson

I used the Linux CLI history (up arrow) to save typing . . . so . . . one error, repeatedly.

Everything with moodle installation has been going so well, I should've  guessed I was getting in my way.

Your graphic gave a needed laugh, 

'mysqldump' swallowing a dump

it seems almost recursive . . . 

Thanks for the quick help,

-Jeff