Move Moodle from test server to Production server

Move Moodle from test server to Production server

от Murali Sriram -
Количество ответов: 6

I recently upgraded Moodle from 1.95 to 3.2 on test server and I need to move to Production. Please let me know how can I do that with Sql server as database. Thanks!

В ответ на Murali Sriram

Re: Move Moodle from test server to Production server

от Howard Miller -
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Peer reviewers Изображение пользователя Plugin developers
В ответ на Howard Miller

Re: Move Moodle from test server to Production server

от Murali Sriram -

Hey Miller, 

Thanks for responding. I checked that document before and its pointing to mysql . I am using sql server. Is there any different process to migrate?


Thanks

В ответ на Murali Sriram

Re: Move Moodle from test server to Production server

от Howard Miller -
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Peer reviewers Изображение пользователя Plugin developers

I've never used sql server but essentially, I doubt there's a difference. You have to export/dump the database from the test site and import it on the production site. I'm assuming you either know how to do that or can easily find out (it's not specific to Moodle after all).

В ответ на Murali Sriram

Re: Move Moodle from test server to Production server

от Luis de Vasconcelos -
Изображение пользователя Particularly helpful Moodlers

Migrating a MSSQL database is simple:

  1. Using SQL Management Studio backup the Moodle database on the test machine. That will produce a .bak file.
  2. Install SQL Server in the production environment.
  3. Restore that .bak file to a new database on that SQL Server production environment.
  4. Create the database user in Management Studio and link it to the Moodle database on production. Make sure it has full create/drop/select/insert/update/delete permissions.
  5. In your Moodle config.php file change $CFG->dbhost to point to your production database host.
  6. Update the other variables like $CFG->dbname, $CFG->dbuser and $CFG->dbpass with the production host details.
  7. You should probably also use $CFG->dbtype = 'sqlsrv'; so that PHP can connect to MSSQL. For that to work you need to make sure that MS SQLSRV driver has been loaded in your php.ini file and that PHPInfo() shows the SQLSRV section.

After doing that Moodle should be able to connect to SQL Server on the production instance.

https://docs.moodle.org/34/en/Installing_MSSQL_for_PHP

https://docs.moodle.org/34/en/Using_the_Microsoft_SQL_Server_Driver_for_PHP

В ответ на Luis de Vasconcelos

Re: Move Moodle from test server to Production server

от Murali Sriram -

Hi Luis,

As you mentioned, I did the following process from my end.


1. Performed backup on test database 

2. Restored the .bak file on new database 

3. Created a database user and granted the permissions as you described.

4. In the config.php  changed the  dbhost pointing to production database.

5 Updated the other variables like dbname, dbuser and dbpass.

7. Updated the dbtype to 'sqlsrv'.

When I am trying to connect to the moodle from the application pool, stuck up with the following message attached. Help me on it. Thanks!




Приложение moodle error message.JPG