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!
Read - Moodle_migration
Any questions, just ask!
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
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).
This is my first time to work on moodle. SO I am little confusing on how to move the course and everything.
Re: Move Moodle from test server to Production server
Migrating a MSSQL database is simple:
- Using SQL Management Studio backup the Moodle database on the test machine. That will produce a .bak file.
- Install SQL Server in the production environment.
- Restore that .bak file to a new database on that SQL Server production environment.
- 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.
- In your Moodle config.php file change $CFG->dbhost to point to your production database host.
- Update the other variables like $CFG->dbname, $CFG->dbuser and $CFG->dbpass with the production host details.
- 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
Re: Move Moodle from test server to Production server
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!