Está en la página 1de 3

1.

The main thing would be adjusting any hard-coded


paths to files -- both in the code and in php.ini (since the filepaths
in Linux use / to separate directories). You will probably need to
check permissions on directories and files that the application
requires.
2. PHP file names should be in lower case so that they can be easily portable on
different servers.
3. The MySQL table names field names are case-sensitive on linux servers.
Better to go with lowercase names on both servers (wamp and lamp).

4. Generally, PHP code is portable with zero rewrites, unless OS-specific


extensions are used. For example, shared memory and semaphores are not
available on Windows, while COM is available only on Windows. So an
application relying on shared memory or semaphores will not work under
Windows, while an application using COM will work only on Windows.

5. MySQL needs at least Linux version 2.0.

6. PHP.ini settings on different servers can cause big differences in handling of


Global variables.

Moving Mambo from one server to another server

To move your Mambo site from either one folder to another or one server to
another, here are a few basics.

Copy over your files, either via ftp or SSH/command line


Backup and then restore your database - perhaps using phpmyadmin or
SSH/command line (this step only needed if moving site from one server to
another.
Edit your configuration.php file to reflect the new values. Specifically the
following:

Quote:
$mosConfig_user = 'mambo_mambo';
$mosConfig_password = 'password';
$mosConfig_db = 'mambo_mambo';
$mosConfig_absolute_path = '/home/mambo/public_html';
$mosConfig_live_site = 'http://www.mamboserver.com';
$mosConfig_cachepath = '/your absolute path/cache';
Note: You may also need to ensure you have configured your .htaccess file in the
new location.

Setting up moodle on a new server

Assumptions:
Config.php settings are still:
$CFG->dirroot = '/var/www/html/moodle';
$CFG->dataroot = '/var/www/moodledata/moodledata';
$CFG->dbname = '<yourDBname>';
$CFG->dbuser = '<youruser>';
Backup is set to run following script
cd /var/www/moodledata
mv <yourDBname>.sql.gz <yourDBname>-old.gz
mysqldump -h localhost --add-drop-table -u root --password='<???????>' -C
-Q -e -a <yourDBname>.sql
gzip <yourDBname>.sql

New server is referred to as (2) : Old (current) server is referred to as (1)


Make sure you have a current, good backup of all files in case of accident

1. Download and unzip latest stable moodle version on (2). Do not run this version

at this stage.

2. If they exist then Delete all files from /var/www/moodledata/moodledata on (2)
(make sure that this is the target and not the source!)
 3. Start mysql as root on (2) and type:
Drop database “<yourDBname>”;
Create database “<yourDBname>”;
GRANT Select, Insert, Update,Delete,Create,Drop, Index, Alter on
<yourDBname>.* to <youruser>@localhost identified by
‘<currentpassword>’;
exit
 4. mysqladmin –p reload
 5. Set maintenance mode on (1)
On (2) use

rync –auvtz –delete –e ssh


<yourid>@<yourserver>.<yourdomain>.com:/var/www/moodledata /var/www

This will copy all the moodle data files including the latest mysql backup.
You then need to unzip the most recently backed up dump of the mysql
database at /var/www/moodledata/ (should be <yourDBname>.sql.gz)
This method means you can skip to point 11
 6. On (2) start mysql as root and type the following:
Use <yourDBname>;
Source /var/www/moodledata/mysql/<yourDBname>.sql;
quit
7. Set ownership of files in moodledata (on (2)) to apache. Eg “chown –R
apache:apache moodledata”. Repeat this for the moodle directory as well.
 8. Shut server (1) down
9. Test that moodle works on (2) by logging in as admin and looking at a couple of
 courses. If you have also updated to a newer version of moodle then this is the
point at which the database is updated
 10. Physically replace server(1) by server(2)
 11. Test again.
12. Set up Cron
13. Create command file to

#!/bin/bash
cd /var/www/moodledata
mv <yourDBname>.sql.gz <yourDBname>-old.gz
mysqldump -h localhost -u root -C -Q -e -a <yourDBname> >
<yourDBname>.sql
gzip <yourDBname>.sql

También podría gustarte