Search the Manual:

How to Migrate a Bistro Site to Another Host

When building a new website, many designers and developers will create a development area where they store the website until it is complete, at which point they migrate the site to the live web space. This tutorial will walk you though the process of migrating a Bistro site from the development hosting space, to the live hosting space.

Before You Start

This tutorial assumes that you have already installed Bistro in your development hosting space, and that your site has been designed, developed, and is ready to launch. This tutorial also assumes that you have already purchased and configured the live space, and that it's waiting to be filled with your new website.

For database operations, this tutorial also assumes that you are comfortable using phpMyAdmin to interact with your MySQL databases.

If you are replacing an existing website with a new one, be sure to make a backup of the existing site before you proceed with this tutorial.

Overview

In summary, to migrate a site to the live web space, you will need to complete the following steps:

  1. Migrate the Database
  2. Migrate the Files
  3. Modify the Config File

These steps should be performed in this order to minimize the amount of downtime and disruption to the live website.

Migrate the Database

The first step is to export the existing (development) database. To do this, open phpMyAdmin on the development hosting space (you can get to phpMyAdmin through CPanel, Plesk or Exim) and select the database that is storing your website's information from the drop-down menu (as illustrated in the image to the right)

Once you have selected the name of the database the main frame of phpMyAdmin will refresh, displaying a summary of the database. From this page, select the Export tab, as shown below.

There are many options on this page, to complete the export, scroll down to the bottom of the page, and check the box marked "Save as file" then click "Go".

Note, if you forget to check the "Save as file" box, then your database export will be displayed in the browser window, as opposed to being downloaded as a database export.

After clicking Go, a dialog will pop up, click "Save" and find a location to store your file (it will be saved as a .sql file type). Once you have found a location, click "Save".


Once you have downloaded the file, create a new database on the live hosting space (for more information on how to create a database, review the section in this manual entitled "Creating an Empty Database").

While creating an empty database, you may end up creating a new database user: be sure to record the database name, the username and the password as you will need them later.

After creating your new database, open phpMyAdmin and select the newly-created database from the drop-down list provided. Then, from the main menu, select import.

Once the import screen has loaded, click the "Browse..." button (see image below). This will pop open a dialog window - use this window to locate the export file you saved earlier in this tutorial, then click "Open" to dismiss the dialog. Finally, click "Ok" to import your database.

Congratulations! You have successfully migrated your database! You may now exit phpMyAdmin.

Migrate the Files

This step is as straight-forward as you may think. To move the files from the development space to the live space, all you need to do is use your FTP client to download the files from your development area, and then use your FTP client to upload the files to your live hosting area. If you do not currently have an FTP client, a good free FTP client is Filezilla, which you can download from http://filezilla.sourceforge.net.

Once you have uploaded all your files, you are almost done - but your website will still be broken: you must modify the Bistro configuration file so that your website is using the settings for your new web space.

Modify the Config File

Bistro stores several key configuration settings in a configuration file. You will need to download the file via ftp, edit the file, and then re-upload it to the server.

The file to download is admin/config/config.inc.php

  1. Once it is downloaded, open it in a text editor (Notepad, Word, or Wordpad are all good tools to use).
  2. Once you have opened the file, replace the database name, username, and password with the appropriate values.
  3. Next, if necessary, you may need to replace the Url, Directory and Relative URL of Bistro.
  4. The diagram below shows a sample config file where the lines you need to change have been highlighted.

/**

* Protect Direct Requests

*/

if (!defined('legalAccess'))

{

die();

}

/**

* Database Defines

*/

define('BistroDbName', 'Bistro');

define('BistroDbUser', 'username');

define('BistroDbPassword', 'password');

define('BistroDbServer', 'localhost');

define('BistroDbPrefix', 'w25_');

define('BistroDbDriver', 'mysql');

define('BistroDbPort', '3306');

/**

* Folders and Files

*/

define('BistroUrl', 'http://www.developmentsite.com/newSite/');

define('BistroDir', '/home/devel/public_html/newSite/');

define('BistroRelative', '/newSite/');

define('BistroScript', 'index.php');

?>

In the above example, BistroUrl is the full URL to the folder of the live web hosting space that is storing the website. For example, if you are uploading your site for myserver.com, the full URL will be http://www.myserver.com/ (note, that the "http://" and the trailing " / " are both very important).

The setting BistroDir is the full path to the files on the web server. If your server is a windows server, it may be something like c:/InetPub/newSite/www/, and if your server is a linux server, it may be something like /home/newsite/www/. If you need any help determining the full path, contact your web host.

Finally, the setting BistroRelative is simply the relative URL of the website (everything after the server in the URL). So, if the website is www.newsite.com, then the setting should simply be "/", if the website is www.newsite.com/Bistro/ then the setting should be "/Bistro/".