— I first installed the shopping cart on my test server. Then I customized the design, added products, defined taxes and configured other settings. Now my test store is all ready to go live. How do I transfer it to my live server?
You should transfer 2 things:
Store database should be transferred in full.
Store files must also be transferred in full, but there are 7 configuration files that have to be changed after the transfer because they contain absolute paths to some system files and URLs and they will most likely be different on the live server:
|1.|| init.php - contains absolute path to store.php script|
|2.|| js_http_request_frontend.php - contains absolute path to JsHttpRequest.php script (since version 2)|
|3.|| avactis-system/config.php - contains database connection info and store URL|
|4.|| avactis-system/https_config.php - contains HTTPS URL of the store when HTTPS is enabled|
|5.|| avactis-layouts/storefront-layout.ini - contains absolute path to store root folder and store URL(s)|
|6.|| avactis-system/admin/mod_rewrite_test_01/.htaccess - contains URL-path to its own folder|
|7.|| avactis-system/admin/mod_rewrite_test_02/.htaccess - contains URL-path to its own folder|
So after transferring all the files, you should edit these configuration files and replace URLs and paths of the test server with those of the live server.
The complete procedure of transferring the store is as follows:
|1.|| Clear application cache|
|2.|| Dump the database from the test server to a SQL file in store folder|
|3.|| Compress the store folder, including the SQL file on the test server|
|4.|| Copy the archive to the live server|
|5.|| Create a new, empty database on the live server|
|6.|| Extract the archive on the live server|
|7.|| Import the SQL file to the database on the live server|
|8.|| Edit the 7 configuration files to reflect changes in paths and URLs|
Detailed instructions for each step
1. Clear application cache
This can be done in a number of ways:
|•||From shell: rm -rf avactis-system/cache/*|
|•||From admin area: Admin > Clear Cache > Clear.|
|•||From a file manager: delete all contents of avactis-system/cache folder (you can leave .htaccess file).|
If the test server is running Unix or Linux OS and you can run shell scripts on it, next steps 2 and 3 can be done with backup.sh script included in Avactis. Just run avactis-system/backup.sh and you will get an archive with all store files and database dump in avactis-system/backup/ folder. The file is named backup_YYYY-MM-DD_hh-mm-ss.tar.gz (has time of creation in its name). It has an accompanying .abi file with meta information.
2. Dump the database from the test server to a SQL file in store folder
Depending on your setup, the following tools may be available to you:
|•||In shell: mysqldump -uusername -p databasename > database.sql|
|•||In hosting control panel: look for a phpMyAdmin or Web Admin icon in Databases section. If you do not find anything like a database web management, refer to hosting company help & support.|
|•||Via FTP: upload this PHP script to your test server, open it in your web browser and use the Dump link.|
3. Compress the store folder, including the SQL file on the test server
|•||In shell: tar czf store.tgz *|
|•||In hosting control panel: select all files and folders in store folder and click Zip or Archive button. This function is different in different control panels, so look around to find it. Some control panels may lack this function completely.|
4. Copy the archive to the live server
|•||In shell on the live server: use either ftp (interactively) or wget to retrieve the archive from the test server.|
|•||Via FTP: download the archive (or all uncompressed files if you could not compress them) from the test server and upload it (them) to the live server.|
If you've made a full backup using backup.sh, copy both .tar.gz and .abi files from avactis-system/backup/ folder.
5. Create a new, empty database on the live server
|•||In hosting control panel: look for a Databases section and an Add New or Create New button in it.|
If you have .tar.gz and .abi files with backup, the next steps 6 and 7 can be done with restore.sh script from Avactis 2.0 (users of earlier versions can download the updated scripts). Run the script with 3 arguments:
restore.sh backup_YYYY-MM-DD_hh-mm-ss.tar.gz path_to/store_folder/ empty_database_name
If database username or password is different from the test server, the script may fail to import the database. Then do step 7 manually.
6. Extract the archive on the live server
|•||In shell: tar xzf store.tgz|
|•||In hosting control panel: select the archive file and click Unzip or Extract button. This function is different in different control panels, so look around to find it. Some control panels may lack this function completely.|
7. Import the SQL file to the database on the live server
|•||In shell: mysql -uusername -p databasename < database.sql|
|•||In hosting control panel: look for a phpMyAdmin or Web Admin icon in Databases section - it has the Import tab where you can upload the SQL file.|
|•||Via FTP: upload this PHP script to your test server, open it in your web browser and use the SQL command link.|
8. Edit the 7 configuration files to reflect changes in paths and URLs
|•||In shell: vim filename or vi filename|
|•||In hosting control panel / Via FTP: select each configuration file, click Edit button, make changes and save the file.|
You can find out absolute paths to enter in the configuration files from the helper.php script (open it in your browser).