OSCLASS Tips : How to move OSCLASS website from live server to localhost development server ?
This post is about how to move OSCLASS website from live server to local development server. The process in a nutshell is pretty forward that is, to download the website files and put them in the local website directory, export database from the live server to the local server and update configuration files on development server. But there are some minute updates or changes required to let OSCLASS work on localhost development server, which we will see in brief in this post.
So, to download an OSCLASS website from live server to localhost development server, the following steps will be involved. For the purpose of this example, we shall download and deploy the website at "C:\xampp\htdocs\eadsprod" on Windows running XAMPP.
- Download the website files from live server
- Export Database from live server and import the database on the local development server
- Update database details in OSCLASS config file
- Update HTACCESS file on local development server
- Download the website files from live server
Using FTP Client or the file manager web interface provided by the web host, download the website files to the local development server.
TIP: Downloading an archive is faster than smaller individual files
You may create an archive of "/httpdocs" (if OSCLASS website is not on subdomain or subdirectory) and download the archived "httpdocs.zip" via FTP client or the same web interface.
After the download, extract the archive and put the contents into "eadsprod" at "C:\xampp\htdocs\".
- Export Database from live server and import the database on the local development server
Access phpMyadmin on local development server and import the database SQL file downloaded.
- Update database details in OSCLASS config file
Edited Config.Php file looks like this:
<?php
/**
* The base MySQL settings of Osclass
*/
define('MULTISITE', 0);
/** MySQL database name for Osclass */
define('DB_NAME', 'eadsprod');
/** MySQL database username */
define('DB_USER', 'root');
/** MySQL database password */
define('DB_PASSWORD', 'root');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Table prefix */
define('DB_TABLE_PREFIX', 'os_');
define('REL_WEB_URL', '/eadsprod/');
define('WEB_PATH', 'http://localhost/eadsprod/');
?>
/**
* The base MySQL settings of Osclass
*/
define('MULTISITE', 0);
/** MySQL database name for Osclass */
define('DB_NAME', 'eadsprod');
/** MySQL database username */
define('DB_USER', 'root');
/** MySQL database password */
define('DB_PASSWORD', 'root');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Table prefix */
define('DB_TABLE_PREFIX', 'os_');
define('REL_WEB_URL', '/eadsprod/');
define('WEB_PATH', 'http://localhost/eadsprod/');
?>
The OSCLASS database configuration details above are as per the local development server. When OSCLASS database is moved from local to production server, the same details have to be edited as per the details of the database on the production server.
- Update HTACCESS file on local development server
OSCLASS HTACCESS file from production server was:<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Changed OSCLASS HTACCESS file on development server to:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /eadsprod/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /eadsprod/index.php [L]
</IfModule>
RewriteEngine On
RewriteBase /eadsprod/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /eadsprod/index.php [L]
</IfModule>
Comparing the above two HTACCESS files, we see that on the development server, "eadsprod" have been included to "RewriteBase" and "RewriteRule " because on the local development server, the OSCLASS website if hosted from "/eadsprod".
Without the proper path edited in the HTACCESS file on thedevelopment server, the home page might open but internal links may not work properly.
good guide
ReplyDelete