| How to transfer your Joomla site |
|
|
|
| Written by axel | |||||||||
|
In this guide I will describe you how to move your Joomla site from a web server to your pc for local testing. However the same procedure should be ok for moving the Joomla installation to a new web server or another Linux pc. I will assume that the original site is hosted in a Linux server and you want to transfer it to your Windows box.
The steps you will have to get through in order to move your site are the following:
1. Files BackupFirst we have to back up all the files from our site.
If you have an ssh account for your site login and go to your site's root directory. For example if your site is named http://www.site.com go to the directory which contains the site / directory. Normally this should be the first directory that your ssh account logs you in. Here type:
tar -czf backup.tar.gz site/
This should take a while depending on how big is your site. When the command will stop being executed download the backup.tar.gz file to your pc. Don't forget to delete the backup.tar.gz file from your web server. Delete it by typing:
rm -f backup.tar.gz
![]() Next click on the "Home Directory" button under Download a Home Directory Backup. Wait a little and you will be prompted to download the backup. ![]() 2. MySQL BackupNow, it's time to back up the database of your site. Log in to your phpMyAdmin account. Take a look at the MySQL version your server uses. Note it down since you will need it later for the import proccess in case it is differnet from version 5. Here I have version 5.0.16.![]() To export the whole database click on the Export link. ![]()
Select your database from the Export list (1), tick "Add DROP TABLE / DROP VIEW" (2), tick "gzipped" (3) and click the "Ok" button (4). When the backup proccess is completed you will prompted to download the mysql.site.gz file.
![]() 3. Installing Windows http/php/mysql Server
We are going to use WAMP which is a very easy way to install Apache, PHP and MySQL with a few clicks! Download it from here and install it. Just leave the default settings. They are ok.
4. Restore site files
Take the backup.tar.gz file you created before, copy it under C:\wamp\www and extract it there. Now you should have a directory C:\wamp\www\site which contains all your site's files.
5. Edit site files
$mosConfig_absolute_path = '/home/site'; $mosConfig_cachepath = '/home/.user/site/cache'; $mosConfig_host = 'mysql.site.net'; $mosConfig_live_site = 'http://www.site.com'; $mosConfig_password = 'your_database_password'; $mosConfig_user = 'your_database_username'; and change them like that: $mosConfig_absolute_path = 'C:/wamp/www/site'; $mosConfig_cachepath = 'C:/wamp/www/site/cache'; $mosConfig_host = 'localhost'; $mosConfig_live_site = 'http://localhost/site'; $mosConfig_password = ''; $mosConfig_user = 'root'; Save and exit.
# RewriteBase / to RewriteBase /site Save and exit. 6. Restore MySQL databaseNow let's see how you can restore your MySQL Database. Run Wampserver from the start menu. If it loads ok a white icon should appear in your tray. Click on it and then click phpMyAdmin. phpMyAdmin should load in your browser. Click import.![]() Here click the browse button (1) and find the mysql.site.sql.gz file you created before. Wampserver has MySQL version 5, therefore if you previously had noted another version such as 4 you must change the 'SQL compatibility mode' (2). Finally click "Go" (3). Wait for a few minutes and the database will be imported. ![]() However a few problems might occur at this step.
The maximum imported sql file size is 2,048KiB which means that if your database backup is larger than 2MB you can't load it. Moreover the upload script may need more memory than the amount provided by php.
To solve those problems open the file C:\wamp\bin\apache\apache2.2.6\bin\php.ini and change the following lines: post_max_size = 8M upload_max_filesize = 2M memory_limit = 8M to post_max_size = 20M upload_max_filesize = 20M memory_limit = 20M
Save and exit. Click on the wamp tray icon and select "Restart All Services". Now go again to http://localhost/phpmyadmin/, click the Import link and the Maximum upload size should be 20,480 KiB as shown in the image below.
![]()
Alternatively you can configure phpmyadmin to use a directory of your system as the default upload dir. To do so create a directory named upload in C:\wamp and copy in there the needed file e.g. mysql.site.sql.gz Next edit C:\wamp\apps\phpmyadmin2.10.1\config.inc.php Change the line:
$cfg['UploadDir'] = ''; to $cfg['UploadDir'] = '../../upload';
Save, exit and restart all services from wamp tray icon. Now when you log in phpmyadmin and go to the Import screen you will notice a drop down menu with mysql.site.sql.gz in it (1). Select it and click 'Go' to restore the database.
**Note: If you haven't placed any files in the upload directory the option 'web server upload directory won't be available'. ![]() You might also face the following error in case your database is too big "Script timeout passed, if you want to finish import, please resubmit same file and import will resume." In that case you must edit C:\wamp\apps\phpmyadmin2.10.1\config.inc.php Change the line: $cfg['ExecTimeLimit'] = 300; to $cfg['ExecTimeLimit'] = 0; Save, exit and restart all services from wamp tray icon. Then try again to import your database. When the upload completes successfully you will see a message "Import has been successfully finished, #### queries executed." 7. Final Apache Configuration
In order the site to work properly you must have the rewrite_module enabled in your apache configuration. To do so, click on the wamp tray icon and click on Apache Modules -> rewrite_module the one you see in the image below.
![]() All services should restart automatically. When they restart open your favorite browser and type in the address bar: http://localhost/site Did you enjoy this article? Please share it!
Set as favorite
Bookmark
Email This
Hits: 9259 Comments (3)
![]()
Busby SEO Test
said:
|
|||||||||
|
Hi dear, thanks for complete tutorial... but honestly, i cant. there are no feature $cfg['ExecTimeLimit'] like you said there. Would you show me more than ? thanks. |
|
|
report abuse
vote down
vote up
|
alex
said:
|
Hi i keep getting this error when i am trying to import my database #1044 - Access denied for user 'collegh1'@'localhost' to database 'colleg21_teline' |
|
|
report abuse
vote down
vote up
|
Write comment
| < Prev | Next > |
|---|

















