Home
Software
Support
Tips
Purchase
Free Stuff
Company
Resources

Merchant Tips

Working with your Store offline

It is often times easier to work with your Merchant Store in offline mode. This is especially true if you are adding a lot of products, changing the User Interface, need to perform maintenance, or simply wish to make changes without affecting the live store.

As you may know, Merchant is powered by the Miva Empresa Engine. Empresa is similar to Perl in that it is an interpreter that sits in front of the Web Server. Empresa processes special files that contain the Miva Script Language and outputs the resultant HTML to the browser. Merchant is written in the Miva Script Language and it requires Empresa in order to function.

Miva Mia is a personal version of the Empresa Engine. Mia is, in fact, a mini Web Server since it can serve up HTML documents as well as Miva Script documents. Miva Mia enables developers to test their Miva Script applications locally, before deploying their applications on a Web Server. Mia also allows you to run your store offline, on your own computer.

Installing and Running Miva Mia

Miva Mia is provided free of charge by Miva Corporation. Documentation and download instructions are available at the Miva Web Site.

By default, Miva Mia will install itself to the C:\Program Files\Miva\MivaMia directory. It will also create a shortcut on your desktop. In addition, it will create an HTML and a Data directory which are named:

C:\MivaMia\HTML
C:\MivaMia\Data

The HTML Directory will correspond to your Web Site's Document Root directory (the directory where your HTML pages are located). The Data Directory will correspond to the Miva Empresa Data directory (the directory where Miva Script programs, which includes Miva Merchant, store their Data Files).

After installing Mia, you should run it and make sure it was installed correctly. Clicking on the Show Home Page button on the Status tab should cause the Miva Mia home page to appear in your browser.

After verifying that Miva Mia is properly configured, you are ready to download the Merchant files from your online store.

Directory Correlation

It is important to understand the correlation between the Miva Mia directories and your Store's Merchant directories.

Merchant is installed in a directory named Merchant2 (or Merchant). This directory is inside of your Web Site's Document Root directory (also called the Public HTML directory). This is the directory where the merchant.mv and admin.mv files are located. Upon initial setup and configuration, Merchant will create several database files in the Miva Empresa Data directory, under a sub-directory named Merchant2 (or Merchant). The Data directory will be outside of your Document Root. The Merchant2 (or Merchant) Data directory will contain .dbf files as well as at least 3 sub-directories, one of which is named 00000001.

Live and Local Directory Correlation

The Merchant Document directory corresponds to your Miva Mia HTML directory and the Merchant Data directory corresponds to your Miva Mia Data directory (except that they will be contained within a directory named Merchant2).

Downloading your Store Files

Using FTP, logon to your Web Site and locate the Merchant2 Document directory (the directory where the Merchant Script and graphic files reside). This directory will contain files and sub-directories similar to this:

Remote Merchant Document Directory

Download the entire Merchant2 directory (including the directory itself) to your Miva Mia HTML directory so that you end up with a directory structure similar to this:

Local Merchant Document Directory

Note that you need to transfer the entire Merchant2 directory so that you end up with a Merchant2 directory in your MivaMia\HTML directory. Your FTP program should allow you to simply copy the Merchant2 directory from your Web Site to your local Miva Mia HTML directory so that you end up with a duplicate of your Merchant Script directory on your computer.

After downloading your Merchant Script directory, navigate to your Miva Empresa Data directory. This directory will normally be outside of your Document Root, perhaps a directory named htsdata, mivadata, datadir, or simply miva. If you are not sure where this Data Directory resides on your Web Site, ask your Hosting Provider. It should contain a directory that was created by Miva Merchant named Merchant2 and within that directory will be files and sub-directories similar to this:

Remote Merchant Data Directory

Once inside the Miva Empresa Data directory, download the entire Merchant2 directory (including the directory itself) to your Miva Mia Data directory so that you end up with a directory structure similar to this:

Local Merchant Data Directory

Note that you need to transfer the entire Merchant2 Data directory so that you end up with a Merchant2 directory in your MivaMia\Data directory. Your FTP program should allow you to simply copy the Merchant2 directory from your Web Site to your local Miva Mia Data directory so that you end up with a duplicate of your Merchant Data directory on your computer. Refer to the correlation chart above.

It is important that you configure your FTP program to transfer Miva Script files (files with an extension of .mv) in ASCII mode and to transfer Database files (files with an extension of .dbf, .dbt, and .mvx) in Binary mode.

Managing your Store Offline

Before you can work with your store offline, you need to first change the Domain Settings. Your Online Store is configured to work with the Web. Your Offline Store needs to be configured to work with your local computer.

Make sure that Miva Mia is running and properly configured. Then, bring up your Browser and type the following in the Address or Location box:

http://127.0.0.1/Merchant2/admin.mv?

Type in your Administrator Login ID and Password and your Merchant Administration screen should appear.

Click on the Domain Settings link on the navigation menu and then click on the Site Configuration tab.

The configuration options are for your Live Store. These need to be changed to reflect the address of your Local Store. Basically, you need to change all occurrences of www.mydomain.com (your Domain Name) to 127.0.0.1 (without the www prefix).

Since you will not be running a Secure Server, also change https to http.

Live Store Settings

Domain Settings - Live Store

Before making any changes, it would be advisable to print this screen so that you can refer to it later if need be (see Uploading your Store Files).

Local Store Settings

Domain Settings - Local Store

Notice how https was changed to http and www.mydomain.com was changed to 127.0.0.1.

When testing your Store locally, you may or may not be able to send confirmation E-Mail's, depending upon how your Mail Server is configured. In the example above, the Mail Server name was modified so that it contains the smtp. prefix as this is how the server is accessed from remote.

Once you have changed and saved the updated URL information, you may then work with your Store using the local copy of the database files. Any changes you make will not affect your live Store.

To test your store locally, use the following URL:

http://127.0.0.1/Merchant2/merchant.mv?

Uploading your Store Files

Any changes that are made to the local copy of your Merchant Store will need to be transferred back to your Live Store. This is accomplished by uploading the modified files to your Web Site.

Before uploading your modifications, be they new or deleted products, a User Interface change, a module addition, or even Merchant Script changes, you should first process any new orders on the Live Site. Failure to do this will result in lost orders!

The Upload process is the reverse of the download process. You need to transfer your local Merchant Data files to your Web Site.

FTP to your Web Site and navigate to the Merchant Data directory. Transfer all files (with the exception of one file) and directories from your MivaMia\Data\Merchant2 directory to your live site's Merchant Data directory.

Uploading Data Files

Notice that you should not upload the domain.dbf file from your local site to your live site. The Domain database file contains the Site Configuration options for your Merchant installation. Since you had to change this configuration in order to work with your Store offline, you do not want to upload these changes to your Live Store, otherwise your Live Store will cease to function. The domain.dbf file is the only file you should not upload. All of the other files and directories should be uploaded since they contain modifications crucial to your Store. For instance, if you add or remove modules, add or remove stores, add or remove Store Administrators, or change the User Interface, you might end up with more files and directories than you started with. You need to upload every file and directory (except for domain.dbf) from your local Merchant2 Data Directory (inside of the Miva Mia Data Directory) to your Web Site's Merchant Data Directory.

Acrobat PDF version of this Document (Click to View or Right Click to Save).